[Ark] Check if file exists before attempting to preview it

Review Request #124050 - Created June 9, 2015 and discarded

Information
Ragnar Thomsen
ark
frameworks
Reviewers
kdeutils
rkcosta

Attempting to preview a file that doesn't exist in the temporary directory crashes Ark. Ideally, this should not happen because only files that exist in an archive should be presented in the QTreeView. However, for the clizip plugin at least, files with filenames containing special characters cause this plugin to not find the file and hence not extract it, and Ark crashes attempting to view it.

This patch adds a simple check to see if the file exists in the temporary directory before attempting to view it. If the file doesn't exist (e.g. could not be extracted by clizip), a KMessageBox::error() is displayed. Also an error is printed in console output.

Tested with the Zip archive provided in https://bugs.kde.org/show_bug.cgi?id=345519.

Issues

  • 2
  • 0
  • 0
  • 2
Description From Last Updated
Wrong coding style: missing a space after the if. Raphael Kubo da Costa Raphael Kubo da Costa
User messages should never have exclamation marks. Raphael Kubo da Costa Raphael Kubo da Costa
Raphael Kubo da Costa
Ragnar Thomsen
Review request changed

Status: Discarded

Change Summary:

The crash was fixed by commit 901593b59e8b6c684f8e823f410e41c939b08b99 and an extraction error should already be detected in the plugin.

Loading...