ProjectExplorer: Handle parsingStarted/Finished in BuildConfiguration

Make all buildconfigurations disabled while the project parses.

This unifies how this is handled in different build systems.

Change-Id: I6afca3743ad1433529a4f9d3bfdf73042799e456
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tobias Hunger
2019-08-14 12:26:59 +02:00
parent 183f01cc1d
commit 988d376ad0
12 changed files with 10 additions and 87 deletions

View File

@@ -362,7 +362,6 @@ void QmakeProject::scheduleAsyncUpdate(QmakeProFile *file, QmakeProFile::AsyncUp
}
file->setParseInProgressRecursive(true);
setAllBuildConfigurationsEnabled(false);
if (m_asyncUpdateState == AsyncFullUpdatePending) {
// Just postpone
@@ -418,7 +417,6 @@ void QmakeProject::scheduleAsyncUpdate(QmakeProFile::AsyncUpdateDelay delay)
}
rootProFile()->setParseInProgressRecursive(true);
setAllBuildConfigurationsEnabled(false);
if (m_asyncUpdateState == AsyncUpdateInProgress) {
m_cancelEvaluate = true;
@@ -476,11 +474,9 @@ void QmakeProject::decrementPendingEvaluateFutures()
if (m_asyncUpdateState == AsyncFullUpdatePending || m_asyncUpdateState == AsyncPartialUpdatePending) {
// Already parsing!
rootProFile()->setParseInProgressRecursive(true);
setAllBuildConfigurationsEnabled(false);
startAsyncTimer(QmakeProFile::ParseLater);
} else if (m_asyncUpdateState != ShuttingDown){
// After being done, we need to call:
setAllBuildConfigurationsEnabled(true);
m_asyncUpdateState = Base;
updateCodeModels();
@@ -731,17 +727,6 @@ void QmakeProject::activeTargetWasChanged()
scheduleAsyncUpdate();
}
void QmakeProject::setAllBuildConfigurationsEnabled(bool enabled)
{
foreach (Target *t, targets()) {
foreach (BuildConfiguration *bc, t->buildConfigurations()) {
auto qmakeBc = qobject_cast<QmakeBuildConfiguration *>(bc);
if (qmakeBc)
qmakeBc->setEnabled(enabled);
}
}
}
static void notifyChangedHelper(const FilePath &fileName, QmakeProFile *file)
{
if (file->filePath() == fileName) {