diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp index 47c8219c060..b6f33a754ff 100644 --- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp @@ -41,7 +41,11 @@ using namespace CMakeProjectManager::Internal; using namespace ProjectExplorer; using namespace Utils; -CMakeLocatorFilter::CMakeLocatorFilter() +// -------------------------------------------------------------------- +// CMakeTargetLocatorFilter: +// -------------------------------------------------------------------- + +CMakeTargetLocatorFilter::CMakeTargetLocatorFilter() { setId("Build CMake target"); setDisplayName(tr("Build CMake target")); @@ -49,15 +53,15 @@ CMakeLocatorFilter::CMakeLocatorFilter() setPriority(High); connect(SessionManager::instance(), &SessionManager::projectAdded, - this, &CMakeLocatorFilter::projectListUpdated); + this, &CMakeTargetLocatorFilter::projectListUpdated); connect(SessionManager::instance(), &SessionManager::projectRemoved, - this, &CMakeLocatorFilter::projectListUpdated); + this, &CMakeTargetLocatorFilter::projectListUpdated); // Initialize the filter projectListUpdated(); } -void CMakeLocatorFilter::prepareSearch(const QString &entry) +void CMakeTargetLocatorFilter::prepareSearch(const QString &entry) { m_result.clear(); const QList projects = SessionManager::projects(); @@ -78,14 +82,14 @@ void CMakeLocatorFilter::prepareSearch(const QString &entry) } } -QList CMakeLocatorFilter::matchesFor(QFutureInterface &future, const QString &entry) +QList CMakeTargetLocatorFilter::matchesFor(QFutureInterface &future, const QString &entry) { Q_UNUSED(future) Q_UNUSED(entry) return m_result; } -void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection, +void CMakeTargetLocatorFilter::accept(Core::LocatorFilterEntry selection, QString *newText, int *selectionStart, int *selectionLength) const { Q_UNUSED(newText) @@ -116,12 +120,12 @@ void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection, buildStep->setBuildTarget(oldTarget); } -void CMakeLocatorFilter::refresh(QFutureInterface &future) +void CMakeTargetLocatorFilter::refresh(QFutureInterface &future) { Q_UNUSED(future) } -void CMakeLocatorFilter::projectListUpdated() +void CMakeTargetLocatorFilter::projectListUpdated() { // Enable the filter if there's at least one CMake project setEnabled(Utils::contains(SessionManager::projects(), [](Project *p) { return qobject_cast(p); })); diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.h b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.h index 28fede0f751..f07b56113b7 100644 --- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.h +++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.h @@ -30,19 +30,21 @@ namespace CMakeProjectManager { namespace Internal { -class CMakeLocatorFilter : public Core::ILocatorFilter +class CMakeTargetLocatorFilter : public Core::ILocatorFilter { Q_OBJECT public: - CMakeLocatorFilter(); + CMakeTargetLocatorFilter(); void prepareSearch(const QString &entry) override; QList matchesFor(QFutureInterface &future, - const QString &entry) override; + const QString &entry) final; void accept(Core::LocatorFilterEntry selection, - QString *newText, int *selectionStart, int *selectionLength) const override; - void refresh(QFutureInterface &future) override; + QString *newText, + int *selectionStart, + int *selectionLength) const final; + void refresh(QFutureInterface &future) final; private: void projectListUpdated(); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 53825f4d7c1..4a1aa92694f 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -75,7 +75,7 @@ public: SimpleRunWorkerFactory runWorkerFactory; CMakeBuildConfigurationFactory buildConfigFactory; CMakeEditorFactory editorFactor; - CMakeLocatorFilter locatorFiler; + CMakeTargetLocatorFilter locatorFiler; CMakeKitAspect cmakeKitAspect; CMakeGeneratorKitAspect cmakeGeneratorKitAspect;