diff options
author | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2010-03-23 15:44:08 +0100 |
---|---|---|
committer | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2010-03-24 09:58:36 +0100 |
commit | 6c5bebe1c4cd3be8efde2f4a2d32f0a038580d51 (patch) | |
tree | b5c1cfef9929ff10a3ba8101ecec3460fb26583d /src/plugins/projectexplorer | |
parent | 6bd7a5a17d9e7546e61333e685e1bfaa12d26e05 (diff) |
Fix updating run control buttons when project has no active runconfig
Reviewed-by: erik verbruggen
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 485eaebf31..91536d39bd 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1672,6 +1672,9 @@ void ProjectExplorerPlugin::startupProjectChanged() d->m_projectsMode->setEnabled(project); if (previousStartupProject) { + disconnect(previousStartupProject->activeTarget(), SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)), + this, SLOT(updateRunActions())); + disconnect(previousStartupProject, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), this, SLOT(updateRunActions())); disconnect(previousStartupProject->activeTarget()->activeRunConfiguration(), @@ -1687,11 +1690,17 @@ void ProjectExplorerPlugin::startupProjectChanged() if (project) { connect(project, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), this, SLOT(updateRunActions())); - connect(previousStartupProject->activeTarget()->activeRunConfiguration(), SIGNAL(isEnabledChanged(bool)), + + connect(project->activeTarget(), SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)), this, SLOT(updateRunActions())); - foreach (Target *t, project->targets()) - connect(t, SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)), + + if (project->activeTarget()->activeRunConfiguration()) { + connect(project->activeTarget()->activeRunConfiguration(), SIGNAL(isEnabledChanged(bool)), + this, SLOT(updateRunActions())); + foreach (Target *t, project->targets()) + connect(t, SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)), this, SLOT(updateActions())); + } } updateRunActions(); |