CppEditor: Use QtConcurrent invocation for async run

Change-Id: Ibbac7f7788fe966c0dd846d68b7d17c43acadb0e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2023-03-03 22:18:46 +01:00
parent d6f5d07639
commit a8214665fe
15 changed files with 97 additions and 106 deletions

View File

@@ -59,20 +59,20 @@ void BaseEditorDocumentProcessor::setParserConfig(
parser()->setConfiguration(config);
}
void BaseEditorDocumentProcessor::runParser(QFutureInterface<void> &future,
void BaseEditorDocumentProcessor::runParser(QPromise<void> &promise,
BaseEditorDocumentParser::Ptr parser,
BaseEditorDocumentParser::UpdateParams updateParams)
{
future.setProgressRange(0, 1);
if (future.isCanceled()) {
future.setProgressValue(1);
promise.setProgressRange(0, 1);
if (promise.isCanceled()) {
promise.setProgressValue(1);
return;
}
parser->update(future, updateParams);
parser->update(promise, updateParams);
CppModelManager::instance()->finishedRefreshingSourceFiles({parser->filePath().toString()});
future.setProgressValue(1);
promise.setProgressValue(1);
}
} // namespace CppEditor