summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-10-16 12:38:48 +0200
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-10-16 14:20:40 +0000
commit09bc8af64568ea5e3f50784a541eb64c185ea95c (patch)
tree1d75782470ed7b5088233d4c48b552b07896f6c3
parent52e35e7e9daf78e4e5774f1b94cb7a57495d9acf (diff)
downloadqt-creator-09bc8af64568ea5e3f50784a541eb64c185ea95c.tar.gz
ToolChainManager: Fix autodetected toolchains going manual
The recent optimization to avoid running toolchains during startup has broken the registration of tool chains with the manager, resulting in auto-detected toolchains being demoted to manual in one run and then getting removed in the next (at which point a new set of toolchains got auto-detected). Change-Id: I175c7344238df1bcb36a8b4949f0f0faf8828116 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r--src/plugins/projectexplorer/toolchainmanager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp
index 1f023119b1..afcf7567b8 100644
--- a/src/plugins/projectexplorer/toolchainmanager.cpp
+++ b/src/plugins/projectexplorer/toolchainmanager.cpp
@@ -213,7 +213,7 @@ void ToolChainManager::restoreToolChains()
}
// Then auto detect
- QList<ToolChain *> detectedTcs;
+ QList<ToolChain *> detectedTcs = tcsToCheck;
QList<ToolChainFactory *> factories = ExtensionSystem::PluginManager::getObjects<ToolChainFactory>();
foreach (ToolChainFactory *f, factories)
detectedTcs.append(f->autoDetect(tcsToCheck));
@@ -226,7 +226,10 @@ void ToolChainManager::restoreToolChains()
// Check whether we had this TC stored and prefer the old one with the old id, marked
// as auto-detection.
for (int i = 0; i < tcsToCheck.count(); ++i) {
- if (*(tcsToCheck.at(i)) == *currentDetected) {
+ if (tcsToCheck.at(i) == currentDetected) {
+ tcsToCheck.removeAt(i);
+ break;
+ } else if (*(tcsToCheck.at(i)) == *currentDetected) {
toStore = tcsToCheck.at(i);
toStore->setDetection(ToolChain::AutoDetection);
tcsToCheck.removeAt(i);