summaryrefslogtreecommitdiff
path: root/src/plugins/qt4projectmanager/qt4project.cpp
diff options
context:
space:
mode:
authorcon <qtc-committer@nokia.com>2009-06-23 14:14:29 +0200
committercon <qtc-committer@nokia.com>2009-06-24 13:41:50 +0200
commit8fd395feb45f7f64e47191fdf22ca4d5ba0dc970 (patch)
tree8a15374f5d17737b4de78ed5b89a9fedbc45f312 /src/plugins/qt4projectmanager/qt4project.cpp
parent936ba4c0702872984d3d9a5fcb27991c79145578 (diff)
downloadqt-creator-8fd395feb45f7f64e47191fdf22ca4d5ba0dc970.tar.gz
Update the enabled state of run configurations on toolchain change.
And if Qt version changed.
Diffstat (limited to 'src/plugins/qt4projectmanager/qt4project.cpp')
-rw-r--r--src/plugins/qt4projectmanager/qt4project.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index d3587f6022..bdddeeb6df 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -834,6 +834,7 @@ int Qt4Project::qtVersionId(const QString &buildConfiguration) const
void Qt4Project::setQtVersion(const QString &buildConfiguration, int id)
{
setValue(buildConfiguration, "QtVersionId", id);
+ updateActiveRunConfiguration();
}
void Qt4Project::setToolChainType(const QString &buildConfiguration, ProjectExplorer::ToolChain::ToolChainType type)
@@ -841,16 +842,32 @@ void Qt4Project::setToolChainType(const QString &buildConfiguration, ProjectExpl
setValue(buildConfiguration, "ToolChain", (int)type);
delete m_toolChain;
m_toolChain = 0;
+ updateActiveRunConfiguration();
+}
+
+void Qt4Project::updateActiveRunConfiguration()
+{
+ if (!activeRunConfiguration()->isEnabled()) {
+ foreach (QSharedPointer<RunConfiguration> runConfiguration, runConfigurations()) {
+ if (runConfiguration->isEnabled()) {
+ setActiveRunConfiguration(runConfiguration);
+ }
+ }
+ }
+ emit runConfigurationsEnabledStateChanged();
+ emit invalidateCachedTargetInformation();
}
ProjectExplorer::ToolChain::ToolChainType Qt4Project::toolChainType(const QString &buildConfiguration) const
{
- ProjectExplorer::ToolChain::ToolChainType type =
+ const ProjectExplorer::ToolChain::ToolChainType originalType =
(ProjectExplorer::ToolChain::ToolChainType)value(buildConfiguration, "ToolChain").toInt();
+ ProjectExplorer::ToolChain::ToolChainType type = originalType;
const QtVersion *version = qtVersion(buildConfiguration);
if (!version->possibleToolChainTypes().contains(type)) // use default tool chain
type = version->defaultToolchainType();
- const_cast<Qt4Project *>(this)->setToolChainType(buildConfiguration, type);
+ if (type != originalType)
+ const_cast<Qt4Project *>(this)->setToolChainType(buildConfiguration, type);
return type;
}