diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index fe95d318313..76439d93b74 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -3,6 +3,7 @@ #include "currentprojectfind.h" +#include "allprojectsfind.h" #include "project.h" #include "projectexplorertr.h" #include "projectmanager.h" @@ -12,10 +13,32 @@ #include using namespace ProjectExplorer; -using namespace ProjectExplorer::Internal; using namespace TextEditor; using namespace Utils; +namespace ProjectExplorer::Internal { + +class CurrentProjectFind final : public AllProjectsFind +{ +public: + CurrentProjectFind(); + +private: + QString id() const final; + QString displayName() const final; + + bool isEnabled() const final; + + void writeSettings(Utils::QtcSettings *settings) final; + void readSettings(Utils::QtcSettings *settings) final; + + QString label() const final; + + TextEditor::FileContainerProvider fileContainerProvider() const final; + void handleProjectChanged(); + void setupSearch(Core::SearchResult *search) final; +}; + CurrentProjectFind::CurrentProjectFind() { connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged, @@ -105,3 +128,10 @@ void CurrentProjectFind::readSettings(QtcSettings *settings) readCommonSettings(settings, "*", ""); settings->endGroup(); } + +void setupCurrentProjectFind() +{ + static CurrentProjectFind theCurrentProjectFind; +} + +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/currentprojectfind.h b/src/plugins/projectexplorer/currentprojectfind.h index c9081bcd9f9..89ca7ae2699 100644 --- a/src/plugins/projectexplorer/currentprojectfind.h +++ b/src/plugins/projectexplorer/currentprojectfind.h @@ -3,37 +3,8 @@ #pragma once -#include "allprojectsfind.h" +namespace ProjectExplorer::Internal { -namespace ProjectExplorer { +void setupCurrentProjectFind(); -class Project; - -namespace Internal { - -class CurrentProjectFind : public AllProjectsFind -{ - Q_OBJECT - -public: - CurrentProjectFind(); - - QString id() const override; - QString displayName() const override; - - bool isEnabled() const override; - - void writeSettings(Utils::QtcSettings *settings) override; - void readSettings(Utils::QtcSettings *settings) override; - -protected: - QString label() const override; - -private: - TextEditor::FileContainerProvider fileContainerProvider() const override; - void handleProjectChanged(); - void setupSearch(Core::SearchResult *search) override; -}; - -} // namespace Internal -} // namespace ProjectExplorer +} // ProjectExplorer::Internal diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 3d77ad8c892..ed710205cee 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -690,7 +690,6 @@ public: ProcessStepFactory m_processStepFactory; AllProjectsFind m_allProjectsFind; - CurrentProjectFind m_curretProjectFind; FilesInAllProjectsFind m_filesInAllProjectsFind; CustomExecutableRunConfigurationFactory m_customExecutableRunConfigFactory; @@ -820,6 +819,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er setupProjectTreeWidgetFactory(); + setupCurrentProjectFind(); + dd = new ProjectExplorerPluginPrivate; setupSanitizerOutputParser();