summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@nokia.com>2011-03-24 14:35:03 +0100
committerTobias Hunger <tobias.hunger@nokia.com>2011-03-24 15:45:31 +0100
commitee4700d934d576522491ec0e0ca049d1b6527ddb (patch)
tree77b4f9334592754e5f4162985bb634ccef309fbb
parent4e564135eff452cc3156d0862b1f1a0ddb8a4f65 (diff)
downloadqt-creator-ee4700d934d576522491ec0e0ca049d1b6527ddb.tar.gz
Handle tool chain configuration changes
Reviewed-by: dt
-rw-r--r--src/plugins/projectexplorer/buildconfiguration.cpp11
-rw-r--r--src/plugins/projectexplorer/buildconfiguration.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp
index 19859186a3..4f6e604677 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<ToolChain *> 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 e3ba32d7f0..9c09964096 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;