From fb477d65675f661f19d75e2f4cdf69b0001b72e2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 2 Jan 2023 13:50:29 +0100 Subject: [PATCH] CppIndexingSupport: Get rid of createSymbolSearcher() Create SymbolSearcher directly instead. Change-Id: I48b054654038a8f3033e858324666c649295e2d4 Reviewed-by: Christian Kandeler Reviewed-by: Qt CI Bot Reviewed-by: --- src/plugins/cppeditor/cppindexingsupport.cpp | 6 ------ src/plugins/cppeditor/cppindexingsupport.h | 2 -- src/plugins/cppeditor/symbolsearcher_test.cpp | 3 +-- src/plugins/cppeditor/symbolsfindfilter.cpp | 2 +- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/plugins/cppeditor/cppindexingsupport.cpp b/src/plugins/cppeditor/cppindexingsupport.cpp index 048adbb0334..d5455942e8f 100644 --- a/src/plugins/cppeditor/cppindexingsupport.cpp +++ b/src/plugins/cppeditor/cppindexingsupport.cpp @@ -334,10 +334,4 @@ QFuture CppIndexingSupport::refreshSourceFiles(const QSet &source return result; } -SymbolSearcher *CppIndexingSupport::createSymbolSearcher( - const SymbolSearcher::Parameters ¶meters, const QSet &fileNames) -{ - return new SymbolSearcher(parameters, fileNames); -} - } // namespace CppEditor diff --git a/src/plugins/cppeditor/cppindexingsupport.h b/src/plugins/cppeditor/cppindexingsupport.h index abf9311787d..584632a4f00 100644 --- a/src/plugins/cppeditor/cppindexingsupport.h +++ b/src/plugins/cppeditor/cppindexingsupport.h @@ -62,8 +62,6 @@ public: QFuture refreshSourceFiles(const QSet &sourceFiles, CppModelManager::ProgressNotificationMode mode); - SymbolSearcher *createSymbolSearcher(const SymbolSearcher::Parameters ¶meters, - const QSet &fileNames); private: Utils::FutureSynchronizer m_synchronizer; }; diff --git a/src/plugins/cppeditor/symbolsearcher_test.cpp b/src/plugins/cppeditor/symbolsearcher_test.cpp index d55d7777a09..9f700d99726 100644 --- a/src/plugins/cppeditor/symbolsearcher_test.cpp +++ b/src/plugins/cppeditor/symbolsearcher_test.cpp @@ -75,9 +75,8 @@ public: QVERIFY(succeededSoFar()); QVERIFY(parseFiles(testFile)); - CppIndexingSupport *indexingSupport = m_modelManager->indexingSupport(); const QScopedPointer symbolSearcher( - indexingSupport->createSymbolSearcher(searchParameters, QSet{testFile})); + new SymbolSearcher(searchParameters, QSet{testFile})); QFuture search = Utils::runAsync(&SymbolSearcher::runSearch, symbolSearcher.data()); search.waitForFinished(); diff --git a/src/plugins/cppeditor/symbolsfindfilter.cpp b/src/plugins/cppeditor/symbolsfindfilter.cpp index 4beaa83d64c..7114beb5ab7 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.cpp +++ b/src/plugins/cppeditor/symbolsfindfilter.cpp @@ -116,7 +116,7 @@ void SymbolsFindFilter::startSearch(SearchResult *search) connect(watcher, &QFutureWatcherBase::finished, this, [this, watcher] { finish(watcher); }); connect(watcher, &QFutureWatcherBase::resultsReadyAt, this, [this, watcher] (int begin, int end) { addResults(watcher, begin, end); }); - SymbolSearcher *symbolSearcher = m_manager->indexingSupport()->createSymbolSearcher(parameters, projectFileNames); + SymbolSearcher *symbolSearcher = new SymbolSearcher(parameters, projectFileNames); connect(watcher, &QFutureWatcherBase::finished, symbolSearcher, &QObject::deleteLater); watcher->setFuture(Utils::runAsync(m_manager->sharedThreadPool(),