From: Peter Penz Date: Sun, 4 Apr 2010 22:34:33 +0000 (+0000) Subject: Add the submenu-name of a service menu entry as prefix. As an alphabetic sorting... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/110cbf5b2777d5451ec83ac42a8c83692d1aa3a9 Add the submenu-name of a service menu entry as prefix. As an alphabetic sorting of all list elements is done, this automatically groups the entries. svn path=/trunk/KDE/kdebase/apps/; revision=1111140 --- diff --git a/src/settings/servicessettingspage.cpp b/src/settings/servicessettingspage.cpp index 726239dbc..14de2d4ae 100644 --- a/src/settings/servicessettingspage.cpp +++ b/src/settings/servicessettingspage.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -151,6 +152,9 @@ void ServicesSettingsPage::loadServices() const QList 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); }