diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-10-21 14:51:07 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-10-21 15:15:33 +0000 |
commit | 287f66c47f1dd769880f81ee3509fe4027fa8d11 (patch) | |
tree | 044c7eef467714701196bed36ecb6288ba6473fa /src | |
parent | 1ffd78bbf508df3c5ee8adf7fc6b7b5439a8454e (diff) | |
download | qt-creator-287f66c47f1dd769880f81ee3509fe4027fa8d11.tar.gz |
Kits: Fix corner-case where default kit changed needlessly
Make sure we add Kits (and update the default kit) before removing
existing kits. This prevents us from losing the information on which
kit is the default one for some random kit selected when the previous
default kit gets deleted.
Task-number: QTCREATORBUG-15209
Change-Id: Ieee3b9fdbcbb4eec524103e4b871287c4de02fc7
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/projectexplorer/kitmodel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/kitmodel.cpp b/src/plugins/projectexplorer/kitmodel.cpp index cd676c70fc..8fea31efd8 100644 --- a/src/plugins/projectexplorer/kitmodel.cpp +++ b/src/plugins/projectexplorer/kitmodel.cpp @@ -218,11 +218,7 @@ void KitModel::validateKitNames() void KitModel::apply() { - // Remove unused kits: - foreach (KitNode *n, m_toRemoveList) - n->widget->removeKit(); - - // Update kits: + // Add/update dirty nodes before removing kits. This ensures the right kit ends up as default. foreach (KitNode *n, itemsAtLevel<KitNode *>(2)) { if (n->widget->isDirty()) { n->widget->apply(); @@ -230,6 +226,10 @@ void KitModel::apply() } } + // Remove unused kits: + foreach (KitNode *n, m_toRemoveList) + n->widget->removeKit(); + layoutChanged(); // Force update. } |