* Add Plasma/PluginApplet as another type of plasmoid service when making KTrader queries
svn path=/trunk/KDE/kdelibs/; revision=1002599
This commit is contained in:
parent
ef32813846
commit
a3a97eec7d
11
applet.cpp
11
applet.cpp
@ -782,7 +782,11 @@ QString Applet::category(const QString &appletName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(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()) {
|
if (offers.isEmpty()) {
|
||||||
return QString();
|
return QString();
|
||||||
@ -1772,6 +1776,7 @@ KPluginInfo::List Applet::listAppletInfo(const QString &category,
|
|||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
//now we have to do some manual filtering because the constraint can't handle everything
|
//now we have to do some manual filtering because the constraint can't handle everything
|
||||||
KConfigGroup constraintGroup(KGlobal::config(), "Constraints");
|
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);
|
QString constraint = QString("'%1' in [X-Plasma-DropMimeTypes]").arg(mimetype);
|
||||||
//kDebug() << "listAppletInfoForMimetype with" << mimetype << constraint;
|
//kDebug() << "listAppletInfoForMimetype with" << mimetype << constraint;
|
||||||
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);
|
||||||
return KPluginInfo::fromServices(offers);
|
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("'");
|
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;
|
QStringList categories;
|
||||||
QSet<QString> known = AppletPrivate::knownCategories();
|
QSet<QString> known = AppletPrivate::knownCategories();
|
||||||
foreach (const KService::Ptr &applet, offers) {
|
foreach (const KService::Ptr &applet, offers) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user