From 1cbb4cc9546c58cec3c3e759b8cbc7bac67ac708 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 2 May 2016 12:57:30 +0200 Subject: QbsProjectManager: Fix SOFT ASSERT: "future.isFinished()" ...in file qbsproject.cpp, line 940. The assert can be triggered with e.g.: 1. Load a bigger qbs project, e.g. qtcreator.qbs. 2. Trigger project build as soon as possible. 3. Cancel the "Parsing C/C++" operation. 4. Wait until the build finished and the assert occurs. This happens because CppModelManager::updateProjectInfo() since commit 536ccc8a8742b38e75547d98ce457b0b90af3ee7 CppTools: Fix incompletely indexed project will check whether the previous indexer run was canceled or not. If it was canceled, it will trigger a full-reindexing of the project. Updating the compiler call data is a special case and it should never trigger an indexing operation, so introduce a dedicated update function for this case. Change-Id: I456945ccf2bf697aaeada572ed87f3acb21a5eaf Reviewed-by: Christian Kandeler Reviewed-by: Eike Ziller --- src/plugins/cpptools/cppmodelmanager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/plugins/cpptools/cppmodelmanager.cpp') diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 2ffd37c14e..08ee406fc8 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -900,6 +900,19 @@ QFuture CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn return indexerFuture; } +ProjectInfo CppModelManager::updateCompilerCallDataForProject( + ProjectExplorer::Project *project, + ProjectInfo::CompilerCallData &compilerCallData) +{ + QMutexLocker locker(&d->m_projectMutex); + + ProjectInfo projectInfo = d->m_projectToProjectsInfo.value(project, ProjectInfo()); + projectInfo.setCompilerCallData(compilerCallData); + d->m_projectToProjectsInfo.insert(project, projectInfo); + + return projectInfo; +} + ProjectPart::Ptr CppModelManager::projectPartForId(const QString &projectPartId) const { return d->m_projectPartIdToProjectProjectPart.value(projectPartId); -- cgit v1.2.1