CMake: cancel file api parsing

Change-Id: Ie59370fa4329f92dd28bf3e147b2828cbd75330b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Eike Ziller
2021-05-31 15:09:28 +02:00
committed by Cristian Adam
parent 392bda1160
commit 58d03f3f2f
3 changed files with 34 additions and 8 deletions

View File

@@ -265,11 +265,14 @@ void FileApiReader::endState(const QFileInfo &replyFi)
m_lastReplyTimestamp = replyFi.lastModified();
m_future = runAsync(ProjectExplorerPlugin::sharedThreadPool(),
[replyFi, sourceDirectory, buildDirectory, topCmakeFile, cmakeBuildType]() {
[replyFi, sourceDirectory, buildDirectory, topCmakeFile, cmakeBuildType](
QFutureInterface<std::shared_ptr<FileApiQtcData>> &fi) {
auto result = std::make_shared<FileApiQtcData>();
FileApiData data = FileApiParser::parseData(replyFi, cmakeBuildType, result->errorMessage);
FileApiData data = FileApiParser::parseData(fi,
replyFi,
cmakeBuildType,
result->errorMessage);
if (!result->errorMessage.isEmpty()) {
qWarning() << result->errorMessage;
*result = generateFallbackData(topCmakeFile,
sourceDirectory,
buildDirectory,
@@ -281,7 +284,7 @@ void FileApiReader::endState(const QFileInfo &replyFi)
qWarning() << result->errorMessage;
}
return result;
fi.reportResult(result);
});
onResultReady(m_future.value(),
this,