From bdce2abf1b6b3574a102fc7b0a95e2914a22b98a Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@digia.com>
Date: Tue, 25 Feb 2014 13:50:56 +0100
Subject: [PATCH] Qbs: Do not re-parse projects while they are built

Qbs may update the buildgraph during the build, so this information
may be lost if we reparse at the same time.

Change-Id: Id52e42552736bbe842581cc87d837d0834ad0a2c
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
---
 src/plugins/qbsprojectmanager/qbsproject.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp
index 03c15752262..f1b43da8ac7 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.cpp
+++ b/src/plugins/qbsprojectmanager/qbsproject.cpp
@@ -45,6 +45,7 @@
 #include <coreplugin/mimedatabase.h>
 #include <cpptools/cppmodelmanagerinterface.h>
 #include <projectexplorer/buildenvironmentwidget.h>
+#include <projectexplorer/buildmanager.h>
 #include <projectexplorer/buildtargetinfo.h>
 #include <projectexplorer/deploymentdata.h>
 #include <projectexplorer/kit.h>
@@ -382,6 +383,12 @@ void QbsProject::parseCurrentBuildConfiguration(bool force)
     if (!m_forceParsing)
         m_forceParsing = force;
 
+    // Qbs does update the build graph during the build. So we cannot
+    // start to parse while a build is running or we will lose information.
+    // Just return since the qbsbuildstep will trigger a reparse after the build.
+    if (ProjectExplorer::BuildManager::isBuilding(this))
+        return;
+
     if (!activeTarget())
         return;
     QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
-- 
GitLab