forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user