PluginManager::getObject(): Remove special support for aggregates

Since no one is using it and it's faster this way.

Change-Id: Ib60d3a54aed98011b2fb4bb7d159e219abebfa7e
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Daniel Teske
2014-05-06 17:56:30 +02:00
parent 01d9e4d70b
commit cf8cae595c
2 changed files with 8 additions and 16 deletions

View File

@@ -68,10 +68,9 @@ public:
QReadLocker lock(listLock());
QList<T *> results;
QList<QObject *> all = allObjects();
QList<T *> result;
foreach (QObject *obj, all) {
result = Aggregation::query_all<T>(obj);
if (!result.isEmpty())
T *result = qobject_cast<T *>(obj);
if (result)
results += result;
}
return results;
@@ -80,12 +79,11 @@ public:
{
QReadLocker lock(listLock());
QList<QObject *> all = allObjects();
T *result = 0;
foreach (QObject *obj, all) {
if ((result = Aggregation::query<T>(obj)) != 0)
break;
if (T *result = qobject_cast<T *>(obj))
return result;
}
return result;
return 0;
}
static QObject *getObjectByName(const QString &name);