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:
parent
bddaa1125d
commit
2be355b79d
@ -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;
|
QStringList engines;
|
||||||
KService::List offers = KServiceTypeTrader::self()->query("Plasma/DataEngine");
|
|
||||||
foreach (const KService::Ptr &service, offers) {
|
foreach (const KService::Ptr &service, offers) {
|
||||||
QString name = service->property("X-KDE-PluginInfo-Name").toString();
|
QString name = service->property("X-KDE-PluginInfo-Name").toString();
|
||||||
if (!name.isEmpty()) {
|
if (!name.isEmpty()) {
|
||||||
|
@ -72,9 +72,15 @@ class PLASMA_EXPORT DataEngineManager: public QObject
|
|||||||
void unloadEngine(const QString &name);
|
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:
|
private:
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user