diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 19859186a3d..4f6e6046775 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -77,6 +77,8 @@ BuildConfiguration::BuildConfiguration(Target *target, const QString &id) : this, SLOT(handleToolChainRemovals(ProjectExplorer::ToolChain*))); connect(ToolChainManager::instance(), SIGNAL(toolChainAdded(ProjectExplorer::ToolChain*)), this, SLOT(handleToolChainAddition(ProjectExplorer::ToolChain*))); + connect(ToolChainManager::instance(), SIGNAL(toolChainUpdated(ProjectExplorer::ToolChain*)), + this, SLOT(handleToolChainUpdates(ProjectExplorer::ToolChain*))); } BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *source) : @@ -180,6 +182,15 @@ void BuildConfiguration::handleToolChainAddition(ProjectExplorer::ToolChain *tc) setToolChain(target()->preferredToolChain(this)); } +void BuildConfiguration::handleToolChainUpdates(ProjectExplorer::ToolChain *tc) +{ + if (tc != m_toolChain) + return; + QList candidates = target()->possibleToolChains(this); + if (!candidates.contains(m_toolChain)) + setToolChain(target()->preferredToolChain(this)); +} + Target *BuildConfiguration::target() const { diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index e3ba32d7f0d..9c09964096a 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -123,6 +123,7 @@ protected: private slots: void handleToolChainRemovals(ProjectExplorer::ToolChain *tc); void handleToolChainAddition(ProjectExplorer::ToolChain *tc); + void handleToolChainUpdates(ProjectExplorer::ToolChain*); private: bool m_clearSystemEnvironment;