Improve handling of corrupt archives by CliPlugins

Review Request #125363 - Created Sept. 23, 2015 and submitted

Ragnar Thomsen
261073, 352949
elvisangelaccio, rkcosta

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.

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



  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Ragnar Thomsen
Elvis Angelaccio
Ragnar Thomsen
Review request changed

Status: Closed (submitted)

Change Summary:

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