From a3a97eec7da67e7d20aa6d52f145968e89c969ed Mon Sep 17 00:00:00 2001 From: Richard Dale Date: Sun, 26 Jul 2009 14:20:31 +0000 Subject: [PATCH] * Add Plasma/PluginApplet as another type of plasmoid service when making KTrader queries svn path=/trunk/KDE/kdelibs/; revision=1002599 --- applet.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/applet.cpp b/applet.cpp index 0b2b02acf..eff4edfce 100644 --- a/applet.cpp +++ b/applet.cpp @@ -782,7 +782,11 @@ QString Applet::category(const QString &appletName) } const QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName); - const KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); + KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); + + if (offers.isEmpty()) { + offers = KServiceTypeTrader::self()->query("Plasma/PopupApplet", constraint); + } if (offers.isEmpty()) { return QString(); @@ -1772,6 +1776,7 @@ KPluginInfo::List Applet::listAppletInfo(const QString &category, } KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); + offers << KServiceTypeTrader::self()->query("Plasma/PopupApplet", constraint); //now we have to do some manual filtering because the constraint can't handle everything KConfigGroup constraintGroup(KGlobal::config(), "Constraints"); @@ -1813,6 +1818,7 @@ KPluginInfo::List Applet::listAppletInfoForMimetype(const QString &mimetype) QString constraint = QString("'%1' in [X-Plasma-DropMimeTypes]").arg(mimetype); //kDebug() << "listAppletInfoForMimetype with" << mimetype << constraint; KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); + offers << KServiceTypeTrader::self()->query("Plasma/PopupApplet", constraint); return KPluginInfo::fromServices(offers); } @@ -1832,7 +1838,8 @@ QStringList Applet::listCategories(const QString &parentApp, bool visibleOnly) constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'"); } - const KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); + KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); + offers << KServiceTypeTrader::self()->query("Plasma/PopupApplet", constraint); QStringList categories; QSet known = AppletPrivate::knownCategories(); foreach (const KService::Ptr &applet, offers) {