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  536ccc8a87
  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 <christian.kandeler@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Nikolai Kosjar
2016-05-02 12:57:30 +02:00
parent 506fc40a31
commit 1cbb4cc954
3 changed files with 17 additions and 4 deletions

View File

@@ -935,9 +935,7 @@ void QbsProject::updateCppCompilerCallData()
}
}
m_codeModelProjectInfo.setCompilerCallData(data);
const QFuture<void> future = modelManager->updateProjectInfo(m_codeModelProjectInfo);
QTC_CHECK(future.isFinished()); // No reparse of files expected
m_codeModelProjectInfo = modelManager->updateCompilerCallDataForProject(this, data);
}
void QbsProject::updateQmlJsCodeModel()