From 4994f9e27ab4307b6962bc311c4ea04f2978fd55 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 12 Feb 2013 21:54:08 +0100 Subject: [PATCH] Applet::category(appletName) moved in PluginLoader Applet::category(QString) -> PluginLoader::appletCategory(QString) --- plasma/applet.cpp | 16 ---------------- plasma/applet.h | 6 ------ plasma/pluginloader.cpp | 16 ++++++++++++++++ plasma/pluginloader.h | 7 +++++++ 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/plasma/applet.cpp b/plasma/applet.cpp index 223a97ddb..ce5252ea6 100644 --- a/plasma/applet.cpp +++ b/plasma/applet.cpp @@ -407,22 +407,6 @@ KPluginInfo Applet::pluginInfo() const return d->appletDescription; } -QString Applet::category(const QString &appletName) -{ - if (appletName.isEmpty()) { - return QString(); - } - - const QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName); - KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); - - if (offers.isEmpty()) { - return QString(); - } - - return offers.first()->property("X-KDE-PluginInfo-Category").toString(); -} - ImmutabilityType Applet::immutability() const { // if this object is itself system immutable, then just return that; it's the most diff --git a/plasma/applet.h b/plasma/applet.h index 638fc04f1..2be52644a 100644 --- a/plasma/applet.h +++ b/plasma/applet.h @@ -284,12 +284,6 @@ class PLASMA_EXPORT Applet : public QObject static Applet *loadPlasmoid(const QString &path, uint appletId = 0, const QVariantList &args = QVariantList()); - /** - * Get the category of the given applet - * - * @param appletName the name of the applet - */ - static QString category(const QString &appletName); /** * Returns the icon related to this applet diff --git a/plasma/pluginloader.cpp b/plasma/pluginloader.cpp index a5c6862ce..b212917de 100644 --- a/plasma/pluginloader.cpp +++ b/plasma/pluginloader.cpp @@ -509,6 +509,22 @@ QStringList PluginLoader::customAppletCategories() const return AppletPrivate::s_customCategories.toList(); } +QString PluginLoader::appletCategory(const QString& appletName) +{ + if (appletName.isEmpty()) { + return QString(); + } + + const QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName); + KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); + + if (offers.isEmpty()) { + return QString(); + } + + return offers.first()->property("X-KDE-PluginInfo-Category").toString(); +} + KPluginInfo::List PluginLoader::listDataEngineInfo(const QString &parentApp) { diff --git a/plasma/pluginloader.h b/plasma/pluginloader.h index 4536a4ac4..7b1e07e36 100644 --- a/plasma/pluginloader.h +++ b/plasma/pluginloader.h @@ -178,6 +178,13 @@ public: */ QStringList customAppletCategories() const; + /** + * Get the category of the given applet + * + * @param appletName the name of the applet + */ + QString appletCategory(const QString &appletName); + /** * Returns a list of all known DataEngines. *