diff options
| author | Peter Penz <[email protected]> | 2010-04-04 22:34:33 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2010-04-04 22:34:33 +0000 |
| commit | 110cbf5b2777d5451ec83ac42a8c83692d1aa3a9 (patch) | |
| tree | 8be33e60aa39b2ce42d69a9ebbfbd3ae827e6fd4 /src/settings | |
| parent | a20edc49bd7c53ed1931a7c5145524e372ca6ed3 (diff) | |
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
Diffstat (limited to 'src/settings')
| -rw-r--r-- | src/settings/servicessettingspage.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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 <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); } |
