diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index a25d28e673f..afa4f8ca5e8 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -39,7 +39,6 @@ static bool isProjectParsing() } TestCodeParser::TestCodeParser() - : m_threadPool(new QThreadPool(this)) { // connect to ProgressManager to postpone test parsing when CppModelManager is parsing ProgressManager *progressManager = ProgressManager::instance(); @@ -55,8 +54,6 @@ TestCodeParser::TestCodeParser() }); m_reparseTimer.setSingleShot(true); connect(&m_reparseTimer, &QTimer::timeout, this, &TestCodeParser::parsePostponedFiles); - m_threadPool->setMaxThreadCount(std::max(QThread::idealThreadCount()/4, 1)); - m_threadPool->setThreadPriority(QThread::LowestPriority); m_futureSynchronizer.setCancelOnWait(true); } @@ -363,11 +360,11 @@ void TestCodeParser::scanForTests(const QSet &filePaths, using namespace Tasking; - QList tasks{parallel}; // TODO: use ParallelLimit(N) and add to settings? + QList tasks{ParallelLimit(std::max(QThread::idealThreadCount() / 4, 1))}; for (const FilePath &file : filteredFiles) { const auto setup = [this, codeParsers, file](AsyncTask &async) { async.setConcurrentCallData(parseFileForTests, codeParsers, file); - async.setThreadPool(m_threadPool); + async.setPriority(QThread::LowestPriority); async.setFutureSynchronizer(&m_futureSynchronizer); }; const auto onDone = [this](const AsyncTask &async) { diff --git a/src/plugins/autotest/testcodeparser.h b/src/plugins/autotest/testcodeparser.h index 8effd3b5772..c86de52b943 100644 --- a/src/plugins/autotest/testcodeparser.h +++ b/src/plugins/autotest/testcodeparser.h @@ -94,7 +94,6 @@ private: QList m_testCodeParsers; // ptrs are still owned by TestFrameworkManager QTimer m_reparseTimer; QSet m_updateParsers; - QThreadPool *m_threadPool = nullptr; Utils::FutureSynchronizer m_futureSynchronizer; std::unique_ptr m_taskTree; QHash m_qmlEditorRev;