forked from qt-creator/qt-creator
Core: make ICore interface static
This mainly serves two purposes: (a) it saves a function call in ICore::instance()->foo() vs ICore::foo() at runtime (b) it saves typing and reduces line noise when reading It's also (mostly) source compatible, as ICore::instance()->foo() remains compilable. Change-Id: Icf7be0bce17fefe3560473534a8991ff79cbecc3 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "iwizard.h"
|
||||
#include "coreimpl.h"
|
||||
#include "icore.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
@@ -145,8 +145,7 @@ template <class Predicate>
|
||||
QList<IWizard*> findWizards(Predicate predicate)
|
||||
{
|
||||
// Hack: Trigger delayed creation of wizards
|
||||
if (Core::Internal::CoreImpl *ci = qobject_cast<Core::Internal::CoreImpl*>(ICore::instance()))
|
||||
ci->emitNewItemsDialogRequested();
|
||||
ICore::emitNewItemsDialogRequested();
|
||||
// Filter all wizards
|
||||
const QList<IWizard*> allWizards = IWizard::allWizards();
|
||||
QList<IWizard*> rc;
|
||||
@@ -160,8 +159,7 @@ template <class Predicate>
|
||||
QList<IWizard*> IWizard::allWizards()
|
||||
{
|
||||
// Hack: Trigger delayed creation of wizards
|
||||
if (Core::Internal::CoreImpl *ci = qobject_cast<Core::Internal::CoreImpl*>(ICore::instance()))
|
||||
ci->emitNewItemsDialogRequested();
|
||||
ICore::emitNewItemsDialogRequested();
|
||||
return ExtensionSystem::PluginManager::instance()->getObjects<IWizard>();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user