Commit d412ca62 authored by David Faure's avatar David Faure
Browse files

Remember part URL to delete the tempfile even if the user used save as.

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!!

BUG: 402529

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:
parent b19a2840
......@@ -69,12 +69,11 @@ ArkViewer::~ArkViewer()
// #261785: this preview dialog is not modal, so we need to delete
// the previewed file ourselves when the dialog is closed;
const QString previewedFilePath(>url().toDisplayString(QUrl::PreferLocalFile));>closeUrl();
if (!previewedFilePath.isEmpty()) {
if (!m_fileName.isEmpty()) {
......@@ -204,6 +203,7 @@ bool ArkViewer::viewInInternalViewer(const QString& fileName, const QMimeType &m>openUrl(QUrl::fromLocalFile(fileName));>widget()->setFocus();
m_fileName = fileName;
return true;
......@@ -47,6 +47,7 @@ private:
bool viewInInternalViewer(const QString& fileName, const QMimeType& mimeType);
QPointer<KParts::ReadOnlyPart> m_part;
QString m_fileName;
#endif // ARKVIEWER_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment