kio/KDesktopPropsPlugin-create-destination-dir.patch

30 lines
1023 B
Diff
Raw Normal View History

From a0fc624d50bbd7942834913ece52d26849ba7243 Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Thu, 17 Aug 2017 12:51:53 +0200
Subject: [KDesktopPropsPlugin] Create destination directory if it doesn't
exist
If the directory doesn't exist, applying the changes will fail with
"Could not save properties. You do not have sufficient access to write
to xxx".
---
src/widgets/kpropertiesdialog.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/widgets/kpropertiesdialog.cpp b/src/widgets/kpropertiesdialog.cpp
index 860ad0e..0abcc9c 100644
--- a/src/widgets/kpropertiesdialog.cpp
+++ b/src/widgets/kpropertiesdialog.cpp
@@ -3674,6 +3674,8 @@ void KDesktopPropsPlugin::applyChanges()
const QString path(url.toLocalFile());
+ // make sure the directory exists
+ QDir().mkpath(QFileInfo(path).absolutePath());
QFile f(path);
if (!f.open(QIODevice::ReadWrite)) {
KMessageBox::sorry(nullptr, i18n("<qt>Could not save properties. You do not have "
--
cgit v0.11.2