Commit 73b18440 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik Committed by Kai Uwe Broulik
Browse files

Skip parent directory check if it is already read-only



There's no point in continuing to stat files through `QFileInfo`
if the result will not change.
Signed-off-by: default avatarVictoria Fischer <victoria.fischer@mbition.io>
parent 49ecca4c
Pipeline #151688 skipped
......@@ -47,9 +47,11 @@ QList<QAction*> ExtractFileItemAction::actions(const KFileItemListProperties& fi
}
supportedUrls << url;
// Check whether we can write in the parent directory of the file.
const QString directory = url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile();
if (!QFileInfo(directory).isWritable()) {
readOnlyParentDir = true;
if (!readOnlyParentDir) {
const QString directory = url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile();
if (!QFileInfo(directory).isWritable()) {
readOnlyParentDir = true;
}
}
}
......
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