┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-10-25 13:45:34 +0000
committerPeter Penz <[email protected]>2010-10-25 13:45:34 +0000
commitedd98d7659d028f17185835fc14208d655273c82 (patch)
treeaf22025a134e7b496cf0d8b079389672371e5fdc /src/settings
parent4ca9aeaad2c0f2e00bca52618ad9e6d1cff14b65 (diff)
- Add support for file item actions (see http://reviewboard.kde.org/r/5659/)
- Internal cleanups of DolphinContextMenu code svn path=/trunk/KDE/kdebase/apps/; revision=1189651
Diffstat (limited to 'src/settings')
-rw-r--r--src/settings/services/servicessettingspage.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/settings/services/servicessettingspage.cpp b/src/settings/services/servicessettingspage.cpp
index 7da299399..d2ad90e38 100644
--- a/src/settings/services/servicessettingspage.cpp
+++ b/src/settings/services/servicessettingspage.cpp
@@ -86,7 +86,7 @@ ServicesSettingsPage::~ServicesSettingsPage()
void ServicesSettingsPage::applySettings()
{
- // Apply service menu settings
+ // Apply service menu settingsentries
KConfig config("kservicemenurc", KConfig::NoGlobals);
KConfigGroup showGroup = config.group("Show");
@@ -146,6 +146,7 @@ void ServicesSettingsPage::loadServices()
const KConfig config("kservicemenurc", KConfig::NoGlobals);
const KConfigGroup showGroup = config.group("Show");
+ // Load generic services
const KService::List entries = KServiceTypeTrader::self()->query("KonqPopupMenu/Plugin");
foreach (const KSharedPtr<KService>& service, entries) {
const QString file = KStandardDirs::locate("services", service->entryPath());
@@ -156,10 +157,10 @@ void ServicesSettingsPage::loadServices()
const QString subMenuName = desktopFile.desktopGroup().readEntry("X-KDE-Submenu");
foreach (const KServiceAction& action, serviceActions) {
- const QString service = action.name();
+ const QString serviceName = action.name();
const bool addService = !action.noDisplay()
&& !action.isSeparator()
- && !isInServicesList(service);
+ && !isInServicesList(serviceName);
if (addService) {
const QString itemName = subMenuName.isEmpty()
@@ -168,12 +169,26 @@ void ServicesSettingsPage::loadServices()
QListWidgetItem* item = new QListWidgetItem(KIcon(action.icon()),
itemName,
m_servicesList);
- item->setData(Qt::UserRole, service);
- const bool show = showGroup.readEntry(service, true);
+ item->setData(Qt::UserRole, serviceName);
+ const bool show = showGroup.readEntry(serviceName, true);
item->setCheckState(show ? Qt::Checked : Qt::Unchecked);
}
}
}
+
+ // Load service plugins that implement the KFileItemActionPlugin interface
+ const KService::List pluginServices = KServiceTypeTrader::self()->query("KFileItemAction/Plugin");
+ foreach (const KSharedPtr<KService>& service, pluginServices) {
+ const QString serviceName = service->desktopEntryName();
+ if (!isInServicesList(serviceName)) {
+ QListWidgetItem* item = new QListWidgetItem(KIcon(service->icon()),
+ service->name(),
+ m_servicesList);
+ item->setData(Qt::UserRole, serviceName);
+ const bool show = showGroup.readEntry(serviceName, true);
+ item->setCheckState(show ? Qt::Checked : Qt::Unchecked);
+ }
+ }
}
void ServicesSettingsPage::loadVersionControlSystems()