also support listing info (this one won't be backported because it is a BC addition)

svn path=/trunk/KDE/kdelibs/; revision=911625
This commit is contained in:
Aaron J. Seigo 2009-01-15 19:41:11 +00:00
parent ced5cec1a2
commit 2b579e6d48
2 changed files with 30 additions and 1 deletions

View File

@ -188,6 +188,20 @@ QStringList DataEngineManager::listAllEngines(const QString &parentApp)
return engines;
}
KPluginInfo::List DataEngineManager::listEngineInfo(const QString &parentApp)
{
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/DataEngine", constraint);
return KPluginInfo::fromServices(offers);
}
} // namespace Plasma
#include "dataenginemanager.moc"

View File

@ -21,6 +21,9 @@
#define PLASMA_DATAENGINEMANAGER_H
#include <QtCore/QHash>
#include <kplugininfo.h>
#include <plasma/dataengine.h>
namespace Plasma
@ -72,7 +75,7 @@ class PLASMA_EXPORT DataEngineManager: public QObject
void unloadEngine(const QString &name);
/**
* @return a listing of all known engines by name
* @return a listing of all known DataEngines by name
*
* @param parentApp the application to filter applets on. Uses the
* X-KDE-ParentApp entry (if any) in the plugin info.
@ -82,6 +85,18 @@ class PLASMA_EXPORT DataEngineManager: public QObject
*/
static QStringList listAllEngines(const QString &parentApp = QString());
/**
* Returns a list of all known DataEngines.
*
* @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.
* @return list of DataEngines
**/
static KPluginInfo::List listEngineInfo(const QString &parentApp = QString());
private:
/**
* Default constructor. The singleton method self() is the