Detect error when unrar version is too old
ClosedPublic

Authored by rthomsen on Oct 9 2016, 11:03 AM.

Details

Summary

Unrar 3 and 4 cannot open RAR5 archives. Currently, when opening a RAR5 archive with these old versions there is an uncaught error message which ends up in the comment widget.

This diff adds a check for these error messages in clirar and emits an error signal with a proper message.

CliInterface was changed so that handleLine() passes on the boolean return value of readListLine() to readStdOut(). This way, we can stop readStdOut() from handling further lines when readListLine() returns false. This was needed to avoid multiple error signals being emitted. Previously, the return value of readListLine() was unused.

Unittests were added for both unrar 3 and 4.

Test Plan
  1. Install unrar v3 and v4.
  2. Open a RAR5 archive (these can be created with -ma5 switch).
  3. Check that error messages are shown in the KMessageWidget and not in comment field.

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rthomsen updated this revision to Diff 7227.Oct 9 2016, 11:03 AM
rthomsen retitled this revision from to Detect error when unrar version is too old.
rthomsen updated this object.
rthomsen edited the test plan for this revision. (Show Details)
rthomsen added a reviewer: elvisangelaccio.
rthomsen set the repository for this revision to R36 Ark.
rthomsen added a project: Ark.
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptOct 9 2016, 11:03 AM
elvisangelaccio requested changes to this revision.Oct 9 2016, 1:05 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
autotests/plugins/clirarplugin/clirartest.cpp
223

Use .toString() instead of value<QString>(), according to clazy the latter generates more code because there is a template instantiation

plugins/clirarplugin/cliplugin.cpp
316

Please remove this commented line

324

here too

This revision now requires changes to proceed.Oct 9 2016, 1:05 PM
rthomsen updated this revision to Diff 7232.Oct 9 2016, 3:53 PM
rthomsen edited edge metadata.

Implement Elvis' suggestions.

rthomsen marked 3 inline comments as done.Oct 9 2016, 3:53 PM
elvisangelaccio accepted this revision.Oct 9 2016, 4:12 PM
elvisangelaccio edited edge metadata.
This revision is now accepted and ready to land.Oct 9 2016, 4:12 PM
This revision was automatically updated to reflect the committed changes.