]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Add the submenu-name of a service menu entry as prefix. As an alphabetic sorting...
authorPeter Penz <peter.penz19@gmail.com>
Sun, 4 Apr 2010 22:34:33 +0000 (22:34 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 4 Apr 2010 22:34:33 +0000 (22:34 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=1111140

src/settings/servicessettingspage.cpp

index 726239dbc262b45863dcc284dac060d4856ba8c4..14de2d4ae90eadda61f09e8049942dfb0484f5fc 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <kconfig.h>
 #include <kconfiggroup.h>
+#include <kdesktopfile.h>
 #include <kdesktopfileactions.h>
 #include <kicon.h>
 #include <klocale.h>
@@ -151,6 +152,9 @@ void ServicesSettingsPage::loadServices()
         const QList<KServiceAction> serviceActions =
                                     KDesktopFileActions::userDefinedServices(file, true);
 
+        KDesktopFile desktopFile(file);
+        const QString subMenuName = desktopFile.desktopGroup().readEntry("X-KDE-Submenu");
+
         foreach (const KServiceAction& action, serviceActions) {
             const QString service = action.name();
             const bool addService = !action.noDisplay()
@@ -158,8 +162,11 @@ void ServicesSettingsPage::loadServices()
                                     && !isInServicesList(service);
 
             if (addService) {
+                const QString itemName = subMenuName.isEmpty()
+                                         ? action.text()
+                                         : i18nc("@item:inmenu", "%1: %2", subMenuName, action.text());
                 QListWidgetItem* item = new QListWidgetItem(KIcon(action.icon()),
-                                                            action.text(),
+                                                            itemName,
                                                             m_servicesList);
                 item->setData(Qt::UserRole, service);
                 const bool show = showGroup.readEntry(service, true);
@@ -180,7 +187,6 @@ void ServicesSettingsPage::loadVersionControlSystems()
         QCheckBox* checkBox = new QCheckBox(pluginName, m_vcsGroupBox);
         checkBox->setChecked(enabledPlugins.contains(pluginName));
         connect(checkBox, SIGNAL(clicked()), this, SIGNAL(changed()));
-        connect(checkBox, SIGNAL(clicked()), this, SLOT(feffi()));
         m_vcsPluginsMap.insert(pluginName, checkBox);
     }