From 3b740fccc8a3ba28f40687613fb993ca5ee500f5 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 30 Mar 2020 17:08:16 +0200 Subject: [PATCH] QbsProjectManager: Ensure project data update on target switch ... if necessary. Fixes: QTCREATORBUG-23767 Change-Id: I9a79eebcab348fe0b37d76b31dcbf088d56fc3ca Reviewed-by: hjk --- src/plugins/qbsprojectmanager/qbsproject.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index ed9488f7eb3..8303c24c431 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -540,10 +540,20 @@ void QbsBuildSystem::handleQbsParsingDone(bool success) bool dataChanged = false; bool envChanged = m_lastParseEnv != m_qbsProjectParser->environment(); m_lastParseEnv = m_qbsProjectParser->environment(); + const bool isActiveBuildSystem = project()->activeTarget() + && project()->activeTarget()->buildSystem() == this; if (success) { const QJsonObject projectData = m_qbsProjectParser->session()->projectData(); if (projectData != m_projectData) { m_projectData = projectData; + dataChanged = isActiveBuildSystem; + } else if (isActiveBuildSystem + && (!project()->rootProjectNode() || static_cast( + project()->rootProjectNode())->projectData() != projectData)) { + // This is needed to trigger the necessary updates when switching targets. + // Nothing has changed on the BuildSystem side, but this build system's data now + // represents the project, so the data has changed from the overall project's + // point of view. dataChanged = true; } } else {