diff --git a/libs/widgetutils/xmlgui/kshortcutschemeshelper.cpp b/libs/widgetutils/xmlgui/kshortcutschemeshelper.cpp index 9f76bd507d..f3cebac449 100644 --- a/libs/widgetutils/xmlgui/kshortcutschemeshelper.cpp +++ b/libs/widgetutils/xmlgui/kshortcutschemeshelper.cpp @@ -1,66 +1,61 @@ /* This file is part of the KDE libraries Copyright (C) 2008 Alexander Dymo This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kshortcutschemeshelper_p.h" #include #include #include #include #include #include #include #include #include #include "kactioncollection.h" #include "kxmlguiclient.h" #include "KoResourcePaths.h" #include "kis_action_registry.h" -QString KShortcutSchemesHelper::currentShortcutSchemeName() -{ - return KSharedConfig::openConfig()->group("Shortcut Schemes").readEntry("Current Scheme", "Default"); -} - QString KShortcutSchemesHelper::shortcutSchemeFileName(const QString &schemeName) { // Create a directory if one cannot be found. return KoResourcePaths::locateLocal("kis_shortcuts", schemeName, true); } QHash KShortcutSchemesHelper::schemeFileLocations() { QStringList schemes; schemes << QString("Default"); // Forbid "Default.shortcuts" QHash schemeFileLocations; const QStringList shortcutFiles = KoResourcePaths::findAllResources("kis_shortcuts", "*.shortcuts"); Q_FOREACH (const QString &file, shortcutFiles) { QFileInfo fileInfo(file); QString schemeName = fileInfo.completeBaseName(); if (!schemes.contains(schemeName)) { schemes << schemeName; schemeFileLocations.insert(schemeName, fileInfo.canonicalFilePath()); } } return schemeFileLocations; } diff --git a/libs/widgetutils/xmlgui/kshortcutschemeshelper_p.h b/libs/widgetutils/xmlgui/kshortcutschemeshelper_p.h index 9c706d26ba..6316fa37e6 100644 --- a/libs/widgetutils/xmlgui/kshortcutschemeshelper_p.h +++ b/libs/widgetutils/xmlgui/kshortcutschemeshelper_p.h @@ -1,53 +1,48 @@ /* This file is part of the KDE libraries Copyright (C) 2008 Alexander Dymo This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KSHORTCUTSCHEMESHELPER_P_H #define KSHORTCUTSCHEMESHELPER_P_H #include #include class KActionCollection; class KXMLGUIClient; class KConfigBase; class KShortcutSchemesHelper { public: - /** - * @return the current shortcut scheme name for the application. - */ - static QString currentShortcutSchemeName(); - /** * @return the name of the (writable) file to save the shortcut scheme to. */ static QString shortcutSchemeFileName(const QString &schemeName); static bool saveShortcutScheme(); /** * @return a list of files to save the shortcut scheme to. Does not include "Default" * @see shortcutSchemeFileName, exportActionCollection */ static QHash schemeFileLocations(); }; #endif