diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 0bbd5e780bc..66e52648cca 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -117,8 +117,8 @@ enum { debugLeaks = 0 }; \section1 Object Pool Plugins (and everybody else) can add objects to a common 'pool' that is located in the plugin manager. Objects in the pool must derive from QObject, there are no other - prerequisites. All objects of a specified type can be retrieved from the object pool - via the getObjects() and getObject() functions. + prerequisites. Objects can be retrieved from the object pool via the getObject() + and getObjectByName() functions. Whenever the state of the object pool changes a corresponding signal is emitted by the plugin manager. @@ -132,8 +132,8 @@ enum { debugLeaks = 0 }; MyMimeTypeHandler *handler = new MyMimeTypeHandler(); PluginManager::instance()->addObject(handler); // In plugin A: - QList mimeHandlers = - PluginManager::getObjects(); + MimeTypeHandler *mimeHandler = + PluginManager::getObject(); \endcode @@ -249,29 +249,6 @@ enum { debugLeaks = 0 }; \sa addObject() */ -/*! - \fn QList PluginManager::getObjects() - - Retrieves all objects of a given type from the object pool. - - This function uses \c qobject_cast to determine the type of an object. - - \sa addObject() -*/ - -/*! - \fn QList PluginManager::getObjects(Predicate predicate) - - Retrieves all objects of a given type from the object pool that - match the \a predicate. - - This function uses \c qobject_cast to determine the type of an object. - The predicate should be a unary function taking a T* parameter and - returning a bool. - - \sa addObject() -*/ - using namespace Utils; @@ -319,7 +296,7 @@ PluginManager::~PluginManager() \sa PluginManager::removeObject() \sa PluginManager::getObject() - \sa PluginManager::getObjects() + \sa PluginManager::getObjectByName() */ void PluginManager::addObject(QObject *obj) { @@ -341,7 +318,6 @@ void PluginManager::removeObject(QObject *obj) Usually, clients do not need to call this function. \sa PluginManager::getObject() - \sa PluginManager::getObjects() */ QList PluginManager::allObjects() { diff --git a/src/libs/extensionsystem/pluginmanager.h b/src/libs/extensionsystem/pluginmanager.h index b2ff7378eef..11cf0ae62cd 100644 --- a/src/libs/extensionsystem/pluginmanager.h +++ b/src/libs/extensionsystem/pluginmanager.h @@ -57,31 +57,6 @@ public: static void removeObject(QObject *obj); static QList allObjects(); static QReadWriteLock *listLock(); - template static QList getObjects() - { - QReadLocker lock(listLock()); - QList results; - QList all = allObjects(); - foreach (QObject *obj, all) { - T *result = qobject_cast(obj); - if (result) - results += result; - } - return results; - } - template - static QList getObjects(Predicate predicate) - { - QReadLocker lock(listLock()); - QList results; - QList all = allObjects(); - foreach (QObject *obj, all) { - T *result = qobject_cast(obj); - if (result && predicate(result)) - results += result; - } - return results; - } // This is useful for soft dependencies using pure interfaces. template static T *getObject()