bring into line with Applet::list*; source compat, binary incompat. few users of this, though, and only applications, so impact is nominal. could do it in a BC way by poluting the API with another method that just takes a QString, but we stil have that sliver of a window open before 4.2.0, so use it to keep the API pristine. we can make it ugly after ;)

svn path=/branches/KDE/4.2/kdelibs/; revision=911556
This commit is contained in:
Aaron J. Seigo 2009-01-15 16:41:04 +00:00
parent bddaa1125d
commit 2be355b79d
2 changed files with 19 additions and 4 deletions

View File

@ -165,10 +165,19 @@ void DataEngineManager::unloadEngine(const QString &name)
}
}
QStringList DataEngineManager::listAllEngines()
QStringList DataEngineManager::listAllEngines(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);
QStringList engines;
KService::List offers = KServiceTypeTrader::self()->query("Plasma/DataEngine");
foreach (const KService::Ptr &service, offers) {
QString name = service->property("X-KDE-PluginInfo-Name").toString();
if (!name.isEmpty()) {

View File

@ -72,9 +72,15 @@ class PLASMA_EXPORT DataEngineManager: public QObject
void unloadEngine(const QString &name);
/**
* Returns a listing of all known engines by name
* @return a listing of all known engines by name
*
* @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.
*/
static QStringList listAllEngines();
static QStringList listAllEngines(const QString &parentApp = QString());
private:
/**