Avoid that Krusader crashes when trying to view any archive using the ark part
AcceptedPublic

Authored by asensi on Sun, Aug 18, 7:20 PM.

Details

Reviewers
nmel
gengisdave
Group Reviewers
Krusader
Summary

FIXED: [ 409722 ] Krusader crash when trying to view any archive using the ark part
BUG: 409722

Test Plan

In one tab of e.g. Konsole execute:

touch /tmp/really_empty.zip
ln -s /dev/zero /tmp/too_big.zip
zip /tmp/no_access.zip /etc/fstab
chmod a-rwx /tmp/no_access.zip
krusader -d

Press F3 to try to view a compressed file
See in the Konsole tab:

[...]-debug default PanelViewer::openFile(KFileItem)::<lambda@281 # openFile completed: ' QUrl("file:///[...]") '

Close the window of the viewer.

Press F3 to try to view /tmp/really_empty.zip
See in the Konsole tab:

[...]-debug default PanelViewer::openFile(KFileItem)::<lambda@275 # openFile canceled: ' QUrl("file:///tmp/really_empty.zip") '

Close the window of the viewer.

Press F3 to try to view /tmp/too_big.zip
See a viewer window with the message:

The file /dev/zero could not be loaded, as it was not possible to read from it.
Check if you have read access to this file.    
[Try Again] [Close]

press the "Try Again" button. See in the Konsole tab:

[...]-debug default PanelViewer::openFile(KFileItem)::<lambda@275 # openFile canceled: ' QUrl("file:///tmp/too_big.zip") '

Close the window of the viewer.

Press F3 to try to view /tmp/no_access.zip
See a "No permissions to view this file" message.

Try F3 to view other kind of files like text, jpg, html, etc.

Diff Detail

Repository
R167 Krusader
Lint
Lint Skipped
Unit
Unit Tests Skipped
asensi requested review of this revision.Sun, Aug 18, 7:20 PM
asensi created this revision.

Haven't tested the patch, but the change looks good to me.

krusader/KViewer/panelviewer.cpp
263–268

I'd put this information in the commit message instead. Comments gets outdated pretty easily ;)

asensi edited the test plan for this revision. (Show Details)Sun, Sep 1, 5:15 PM
nmel accepted this revision.Fri, Sep 6, 6:02 AM
nmel added a subscriber: nmel.

Reviewed and tested - works good. Thanks for the fix, Toni!

This revision is now accepted and ready to land.Fri, Sep 6, 6:02 AM
gengisdave accepted this revision.Wed, Sep 11, 8:56 AM
gengisdave added a subscriber: gengisdave.

Tested, it works perfectly with every archive as if it had been opened with Ark