[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kxmlgui] src: KShortcutSchemesHelper: remove unused "dir" argument and mkpath the dir in the code p
From:       David Faure <faure () kde ! org>
Date:       2016-01-31 11:34:40
Message-ID: E1aPqHA-0003rO-6q () scm ! kde ! org
[Download RAW message or body]

Git commit 1ca4581cc01700c3bca6361c03ca5f2cb914d8db by David Faure.
Committed on 31/01/2016 at 11:34.
Pushed by dfaure into branch 'master'.

KShortcutSchemesHelper: remove unused "dir" argument and mkpath the dir in the code \
path that is actually used

CCMAIL: montel@kde.org

M  +3    -9    src/kshortcutschemeshelper.cpp
M  +1    -5    src/kshortcutschemeshelper_p.h

http://commits.kde.org/kxmlgui/1ca4581cc01700c3bca6361c03ca5f2cb914d8db

diff --git a/src/kshortcutschemeshelper.cpp b/src/kshortcutschemeshelper.cpp
index 839bfae..dab4b77 100644
--- a/src/kshortcutschemeshelper.cpp
+++ b/src/kshortcutschemeshelper.cpp
@@ -34,21 +34,15 @@
 #include "debug.h"
 
 bool KShortcutSchemesHelper::exportActionCollection(KActionCollection *collection,
-        const QString &schemeName, const QString &dir)
+        const QString &schemeName)
 {
     const KXMLGUIClient *client = collection->parentGUIClient();
     if (!client) {
         return false;
     }
 
-    QString schemeFileName;
-    if (!dir.isEmpty()) {
-        const QString dirPath = dir + QStringLiteral("shortcuts/");
-        QDir().mkpath(dirPath);
-        schemeFileName = dirPath + client->componentName() + schemeName;
-    } else {
-        schemeFileName = shortcutSchemeFileName(client, schemeName);
-    }
+    const QString schemeFileName = shortcutSchemeFileName(client, schemeName);
+    QDir().mkpath(QFileInfo(schemeFileName).absolutePath());
     QFile schemeFile(schemeFileName);
     if (!schemeFile.open(QFile::WriteOnly | QFile::Truncate)) {
         qCDebug(DEBUG_KXMLGUI) << "COULD NOT WRITE" << schemeFileName;
diff --git a/src/kshortcutschemeshelper_p.h b/src/kshortcutschemeshelper_p.h
index a8381d5..81beb25 100644
--- a/src/kshortcutschemeshelper_p.h
+++ b/src/kshortcutschemeshelper_p.h
@@ -30,16 +30,12 @@ public:
 
     /**
      * Saves actions from the collection to shortcut scheme file.
-     * If the url is given, saves to that directory, otherwise saves to user appdata \
                directory.
      *
      * This doesn't save anything if there's no parent xmlgui client for action \
                collection.
      *
-     * The name of the resulting file is: shortcuts/<scheme name>.rc .
-     *
      *  @return true if the action collection was exported
     */
-    static bool exportActionCollection(KActionCollection *collection, const QString \
                &schemeName,
-                                       const QString &dir = QString());
+    static bool exportActionCollection(KActionCollection *collection, const QString \
&schemeName);  
     /**
      * @return the current shortcut scheme name for the application.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic