Review Request 125363: Improve handling of corrupt archives by CliPlugins
Ragnar Thomsen
rthomsen6 at gmail.com
Wed Sep 23 17:04:02 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125363/
-----------------------------------------------------------
Review request for KDE Utils, Elvis Angelaccio and Raphael Kubo da Costa.
Bugs: 261073 and 352949
http://bugs.kde.org/show_bug.cgi?id=261073
http://bugs.kde.org/show_bug.cgi?id=352949
Repository: ark
Description
-------
A new parameter was added to the Kerfuffle::CliInterfaceParameters enum (called CorruptArchivePatterns), containing a list of regexps matching output from CliPlugins when a corrupt archive is listed.
Due to the CliInterface not being able to launch a KMessageBox itself, a query (LoadCorruptQuery) was added which launches a KMessageBox::warningYesNo asking the user if he wants to try to load the corrupt archive. This is necessary because some files might still be recoverable.
If the user answers no, loading of the archive is cancelled.
If the user answers yes the archive is loaded as usual, but to prevent the user from trying to add/delete files from the corrupt archive (which is likely to fail), the archive is set to readonly. This necessitated a new private member in ReadOnlyArchiveInterface (m_isCorrupt) and getter/setter functions. The setter function is used in CliInterface::HandleLine, while the getter function is used in ReadWriteArchiveInterface::isReadOnly().
Archives can be corrupt in different ways (missing end-of-file, corrupt file header, corrupt entries etc.). Therefore I'm not certain that the regexps catch all forms of corrupt archives at the moment. However, new patterns can easily be added when we discover them.
Diffs
-----
kerfuffle/archiveinterface.h 1aac2a4
kerfuffle/archiveinterface.cpp d8a6725
kerfuffle/cliinterface.h 02f61be
kerfuffle/cliinterface.cpp 179f94f
kerfuffle/queries.h 1630c5e
kerfuffle/queries.cpp 36afaec
plugins/cli7zplugin/cliplugin.cpp 3915cb6
plugins/clirarplugin/cliplugin.cpp e631491
plugins/clizipplugin/cliplugin.cpp 7eaeaaa
Diff: https://git.reviewboard.kde.org/r/125363/diff/
Testing
-------
Tried opening various corrupt rar, zip and 7z archives.
Thanks,
Ragnar Thomsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20150923/d95c5609/attachment.html>
More information about the Kde-utils-devel
mailing list