Review Request 125363: Improve handling of corrupt archives by CliPlugins

Ragnar Thomsen rthomsen6 at gmail.com
Sun Oct 4 14:03:21 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125363/
-----------------------------------------------------------

(Updated Oct. 4, 2015, 2:03 p.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Utils, Elvis Angelaccio and Raphael Kubo da Costa.


Changes
-------

Submitted with commit 170115f17e2be3e1703efe5cec6fea8e762ddd67 by Ragnar Thomsen to branch master.


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 d2273da 
  kerfuffle/archiveinterface.cpp bd6a694 
  kerfuffle/cliinterface.h 0dd3dbe 
  kerfuffle/cliinterface.cpp c16d940 
  kerfuffle/queries.h 1630c5e 
  kerfuffle/queries.cpp 36afaec 
  plugins/cli7zplugin/cliplugin.cpp f0bedc4 
  plugins/clirarplugin/cliplugin.cpp 1931bea 
  plugins/clizipplugin/cliplugin.cpp 4423dda 

Diff: https://git.reviewboard.kde.org/r/125363/diff/


Testing
-------

Tried opening various corrupt rar, zip and 7z archives.


File Attachments
----------------

KMessageBox
  https://git.reviewboard.kde.org/media/uploaded/files/2015/09/23/9fa75094-297c-4116-a1c3-a8cb3668b8e2__Corrupt-1.png


Thanks,

Ragnar Thomsen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20151004/4d7bfc8a/attachment-0001.html>


More information about the Kde-utils-devel mailing list