summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2017-02-07 11:22:53 (GMT)
committerKai Uwe Broulik <kde@privat.broulik.de>2017-02-07 11:22:53 (GMT)
commitacae3816b7ae686542bc4dfeac89ecba7ff5078a (patch)
tree3c4f87a6aa1ac62bd0068509c2688158455dcbec
parent8f9fc02983b0b1e1a03cf8c673adbd459b182119 (diff)
[Solid Device Actions KCM] Encode action file name
Allows to put slashes in there. BUG: 344534 FIXED-IN: 5.8.6 Differential Revision: https://phabricator.kde.org/D4474
-rw-r--r--kcms/solid_actions/SolidActions.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/kcms/solid_actions/SolidActions.cpp b/kcms/solid_actions/SolidActions.cpp
index 38bf8e1..e9bbf34 100644
--- a/kcms/solid_actions/SolidActions.cpp
+++ b/kcms/solid_actions/SolidActions.cpp
@@ -28,6 +28,8 @@
#include <KConfigGroup>
#include <KStandardGuiItem>
+#include <KIO/Global>
+
#include <QComboBox>
#include <QPushButton>
#include <QDebug>
@@ -119,6 +121,7 @@ void SolidActions::addAction()
// Lets get a desktop file
QString internalName = enteredName; // copy the name the user entered -> we will be making mods
internalName.replace(QChar(' '), QChar('-'), Qt::CaseSensitive); // replace spaces with dashes
+ internalName = KIO::encodeFileName(internalName);
QString filePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/solid/actions/"; // Get the location on disk for "data"
if (!QDir().exists(filePath)) {