diff options
author | Tobias Hunger <tobias.hunger@nokia.com> | 2010-03-30 13:23:51 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@nokia.com> | 2010-03-30 13:26:16 +0200 |
commit | b74e80dc9095bf43294c4758783a602bab2e9548 (patch) | |
tree | 8937ff537eff4a78b63d644118e8a69ef97ca953 /src/plugins/projectexplorer | |
parent | 5398651c93b5054ca1895a4c2c7fbc70bbcf6913 (diff) |
Make sure our active target is not changed accidentally
* Adding a project to the project mode used to reset
the active target. Make sure to restore the original one.
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r-- | src/plugins/projectexplorer/targetsettingspanel.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/targetsettingspanel.cpp b/src/plugins/projectexplorer/targetsettingspanel.cpp index 88e84c670a..c21ccf072c 100644 --- a/src/plugins/projectexplorer/targetsettingspanel.cpp +++ b/src/plugins/projectexplorer/targetsettingspanel.cpp @@ -114,6 +114,9 @@ void TargetSettingsPanelWidget::setupUi() connect(m_selector, SIGNAL(currentChanged(int,int)), this, SLOT(currentTargetChanged(int,int))); + // Save active target now as it will change when targets are added: + Target *activeTarget = m_project->activeTarget(); + foreach (Target *t, m_project->targets()) targetAdded(t); @@ -122,11 +125,10 @@ void TargetSettingsPanelWidget::setupUi() connect(m_selector, SIGNAL(removeButtonClicked()), this, SLOT(removeTarget())); - if (m_project->activeTarget()) { - m_selector->setCurrentIndex(m_targets.indexOf(m_project->activeTarget())); - } - updateTargetAddAndRemoveButtons(); + + // Restore target originally set: + m_project->setActiveTarget(activeTarget); } void TargetSettingsPanelWidget::currentTargetChanged(int targetIndex, int subIndex) |