Commit 5a788375 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Start extraction only if Ark has sufficient permissions

Before starting an ExtractJob, we check whether the destination directory
is actually writable and executable. If not, an error message is displayed to the user.

BUG: 192219
FIXED-IN: 15.12.0

Differential Revision: D551
parent b385b865
......@@ -28,6 +28,7 @@
#include "jobs.h"
#include "ark_debug.h"
#include <QFileInfo>
#include <QThread>
#include <KLocalizedString>
......@@ -265,6 +266,13 @@ void ExtractJob::doWork()
}
emit description(this, desc);
QFileInfo destDirInfo(m_destinationDir);
if (destDirInfo.isDir() && (!destDirInfo.isWritable() || !destDirInfo.isExecutable())) {
onError(xi18n("Could not write to destination <filename>%1</filename>.<nl/>Check whether you have sufficient permissions.", m_destinationDir), QString());
onFinished(false);
return;
}
connectToArchiveInterfaceSignals();
qCDebug(ARK) << "Starting extraction with selected files:"
......
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