add the last missing piece: KPluginInfo::List listToolBoxInfo
svn path=/trunk/KDE/kdelibs/; revision=1157557
This commit is contained in:
parent
72a06cdd14
commit
6162c8af99
@ -76,6 +76,26 @@ AbstractToolBox *AbstractToolBox::load(const QString &name, const QVariantList &
|
||||
}
|
||||
}
|
||||
|
||||
KPluginInfo::List AbstractToolBox::listToolBoxInfo(const QString
|
||||
&parentApp)
|
||||
{
|
||||
KPluginInfo::List list;
|
||||
|
||||
if (parentApp.isEmpty() || parentApp == KGlobal::mainComponent().componentName()) {
|
||||
list = KPluginInfo::List();
|
||||
}
|
||||
|
||||
QString constraint;
|
||||
if (parentApp.isEmpty()) {
|
||||
constraint.append("not exist [X-KDE-ParentApp]");
|
||||
} else {
|
||||
constraint.append("[X-KDE-ParentApp] == '").append(parentApp).append("'");
|
||||
}
|
||||
|
||||
KService::List offers = KServiceTypeTrader::self()->query("Plasma/ToolBox", constraint);
|
||||
return list + KPluginInfo::fromServices(offers);
|
||||
}
|
||||
|
||||
Containment *AbstractToolBox::containment() const
|
||||
{
|
||||
return d->containment;
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <QGraphicsWidget>
|
||||
#include <QGraphicsItem>
|
||||
|
||||
#include <kplugininfo.h>
|
||||
|
||||
#include "plasma/plasma_export.h"
|
||||
|
||||
class QAction;
|
||||
@ -66,6 +68,20 @@ public:
|
||||
*/
|
||||
static AbstractToolBox *load(const QString &name, const QVariantList &args=QVariantList(), Plasma::Containment *containment=0);
|
||||
|
||||
/**
|
||||
* Returns a list of all installed ToolBox plugins
|
||||
*
|
||||
* @param parentApp the application to filter applets on. Uses the
|
||||
* X-KDE-ParentApp entry (if any) in the plugin info.
|
||||
* The default value of QString() will result in a
|
||||
* list containing only applets not specifically
|
||||
* registered to an application.
|
||||
*
|
||||
* @since 4.6
|
||||
*/
|
||||
static KPluginInfo::List listToolBoxInfo(const QString
|
||||
&parentApp = QString());
|
||||
|
||||
/**
|
||||
* create a toolbox tool from the given action
|
||||
* @p action the action to associate the tool with
|
||||
|
Loading…
Reference in New Issue
Block a user