diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index 194b4ed7909ea0085857752fc39d3301cfcc4b01..d785bf1097b6c495dd9c192939c248aae88d10d1 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -148,7 +148,7 @@ public: CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelManager) : QObject(modelManager), _modelManager(modelManager), - _resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>()) + _resultWindow(Find::SearchResultWindow::instance()) { m_watcher.setPendingResultsLimit(1); connect(&m_watcher, SIGNAL(resultsReadyAt(int,int)), this, SLOT(displayResults(int,int))); diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp index 45b69f4d7536c33da085edaf1f2025808bb4c2f8..4ee0eea4bc13daa9fb031596b64b1c56d79c6ff9 100644 --- a/src/plugins/find/searchresultwindow.cpp +++ b/src/plugins/find/searchresultwindow.cpp @@ -211,8 +211,11 @@ namespace Internal { using namespace Find::Internal; +SearchResultWindow *SearchResultWindow::m_instance = 0; + SearchResultWindow::SearchResultWindow() : d(new SearchResultWindowPrivate) { + m_instance = this; d->m_widget = new QStackedWidget; d->m_widget->setWindowTitle(displayName()); @@ -271,6 +274,11 @@ SearchResultWindow::~SearchResultWindow() delete d; } +SearchResultWindow *SearchResultWindow::instance() +{ + return m_instance; +} + void SearchResultWindow::setTextToReplace(const QString &textToReplace) { d->m_replaceTextEdit->setText(textToReplace); diff --git a/src/plugins/find/searchresultwindow.h b/src/plugins/find/searchresultwindow.h index 47a80c246824b83feda70db04c6d74a9b25e8d7a..92e58cebbb5bf0b6c5bec20e9c98a45f3946f4e0 100644 --- a/src/plugins/find/searchresultwindow.h +++ b/src/plugins/find/searchresultwindow.h @@ -82,6 +82,7 @@ public: SearchResultWindow(); virtual ~SearchResultWindow(); + static SearchResultWindow *instance(); QWidget *outputWidget(QWidget *); QList<QWidget*> toolBarWidgets() const; @@ -129,6 +130,7 @@ private: QList<SearchResultItem> checkedItems() const; Internal::SearchResultWindowPrivate *d; + static SearchResultWindow *m_instance; }; } // namespace Find diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index f9142768820b7f836ffbbf518d19dfb805e12001..a1f6f8aa8c4da1b4ee57b31a9db2b94468eb26b9 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -318,11 +318,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); AllProjectsFind *allProjectsFind = new AllProjectsFind(this, - pm->getObject<Find::SearchResultWindow>()); + Find::SearchResultWindow::instance()); addAutoReleasedObject(allProjectsFind); CurrentProjectFind *currentProjectFind = new CurrentProjectFind(this, - pm->getObject<Find::SearchResultWindow>()); + Find::SearchResultWindow::instance()); addAutoReleasedObject(currentProjectFind); addAutoReleasedObject(new LocalApplicationRunControlFactory); diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index e314ae3de35f4984483cbe48044e1c477384f994..3c68486cac9e7340baf893039b84d43135b9af36 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -157,7 +157,7 @@ void TextEditorPlugin::extensionsInitialized() ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance(); - m_searchResultWindow = pluginManager->getObject<Find::SearchResultWindow>(); + m_searchResultWindow = Find::SearchResultWindow::instance(); m_outlineFactory->setWidgetFactories(pluginManager->getObjects<TextEditor::IOutlineWidgetFactory>());