forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user