ClangCodeModel: Use Utils::runAsync instead of QtConcurrent::run

That works the same with Qt 5 and Qt 6.

This reverts commit c1fcaa2877.

Change-Id: I603e50c793c2477454253a57bfe01eb25ecab6e3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Eike Ziller
2022-05-12 11:08:06 +02:00
parent 35963fd2b8
commit ff83642681
4 changed files with 17 additions and 18 deletions

View File

@@ -35,6 +35,8 @@
# include "test/clangfixittest.h"
#endif
#include <utils/runextensions.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/messagemanager.h>
@@ -51,8 +53,6 @@
#include <texteditor/textmark.h>
#include <QtConcurrent>
using namespace Utils;
namespace ClangCodeModel {
@@ -83,11 +83,11 @@ void ClangCodeModelPlugin::generateCompilationDB()
const CppEditor::ClangDiagnosticConfig warningsConfig
= warningsConfigForProject(target->project());
QFuture<GenerateCompilationDbResult> task
= QtConcurrent::run(&Internal::generateCompilationDB, projectInfo,
projectInfo->buildRoot(), CompilationDbPurpose::Project,
qMakePair(warningsConfig,
optionsForProject(target->project(), warningsConfig)),
FilePath());
= Utils::runAsync(&Internal::generateCompilationDB, projectInfo,
projectInfo->buildRoot(), CompilationDbPurpose::Project,
warningsConfig,
optionsForProject(target->project(), warningsConfig),
FilePath());
Core::ProgressManager::addTask(task, tr("Generating Compilation DB"), "generate compilation db");
m_generatorWatcher.setFuture(task);
}