diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index a9c2b3fe26d..b264cd2f6c2 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -362,6 +362,12 @@ void QbsProject::buildConfigurationChanged(BuildConfiguration *bc) void QbsProject::startParsing() { + // 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; + parseCurrentBuildConfiguration(false); } @@ -383,12 +389,6 @@ 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(activeTarget()->activeBuildConfiguration()); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index b8b7aa2f622..f91fc35e808 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -476,8 +476,14 @@ void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringLi void QbsProjectManagerPlugin::reparseCurrentProject() { - if (m_currentProject) - m_currentProject->parseCurrentBuildConfiguration(true); + if (!m_currentProject || BuildManager::isBuilding(m_currentProject)) { + // 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. + return; + } + + m_currentProject->parseCurrentBuildConfiguration(true); } } // namespace Internal