SUMMARY The embedded PDF viewer incorrectly deletes the file saved by the user. STEPS TO REPRODUCE 1. launch ARK and open a ZIP file containing a PDF 2. click on the PDF, an embedded viewer appears (okularpart inside ark, right?) 3. From that embedded PDF viewer, use "Save As..." to save the PDF somewhere on your local disk 4. Close the embedded viewer, close ark OBSERVED RESULT The file that you saved, gets deleted !!! EXPECTED RESULT The file should not be deleted, the user put it there. This leads to an extremely frustrating user experience. SOFTWARE/OS VERSIONS Linux OpenSUSE Leap 15.0 KDE Plasma Version: 5.13.90 KDE Frameworks Version: 5.50 Qt Version: 5.11.2 ADDITIONAL INFORMATION I suppose this happens because initially okularpart is opened on a temporary file, so Ark wants to delete the file afterwards. But it should do that using the initial path, not the one that okulartpart contains at the end of the operation (which might have changed due to "Save As").
Fix pending in https://phabricator.kde.org/D18256
Git commit d412ca6255230d809aa550891f1af9049cf092d9 by David Faure. Committed on 15/01/2019 at 18:00. Pushed by dfaure into branch 'Applications/18.12'. Remember part URL to delete the tempfile even if the user used save as. Summary: Using the part URL at closing time is really dangerous: if the user used "save as" (e.g. for an embedded PDF), we'll be deleting the file that the user just saved!! Test Plan: launch ARK and open a ZIP file containing a PDF, click on the PDF, an embedded viewer appears. From there, use "Save As..." to save the PDF somewhere on your local disk. Close the embedded viewer, close ark. It doesn't delete the saved file anymore. Reviewers: elvisangelaccio, broulik Reviewed By: elvisangelaccio Subscribers: kde-utils-devel, #ark Tags: #ark Differential Revision: https://phabricator.kde.org/D18256 M +3 -3 part/arkviewer.cpp M +1 -0 part/arkviewer.h https://commits.kde.org/ark/d412ca6255230d809aa550891f1af9049cf092d9