From 4bfe6f9327687237aaa681aeaf4fda97d7c70de5 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 25 Nov 2014 10:54:47 +0100 Subject: [PATCH] Revert "ToolChains: Do not list ToolChains removed by the sdktool" Obviously the patch removes too much. This reverts commit 9a5f81d96fd81dfeec9edd47c73f74498bc1b897. Change-Id: Id6f128a8d72b51d0d1701a0a82377b56e2a314b2 Reviewed-by: hjk --- .../projectexplorer/toolchainmanager.cpp | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index cbf7861488e..a1abcdbb2b3 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -204,17 +204,15 @@ void ToolChainManager::restoreToolChains() } readTcs.clear(); - Utils::erase(tcsToCheck, [tcsToRegister](ToolChain *toCheck) -> bool { - // Remove TCs configured by the SDK and found in the user settings: - if (Utils::anyOf(tcsToRegister, Utils::equal(&ToolChain::id, toCheck->id()))) - return true; - - // Remove TCs from user settings that are no longer configured by the SDK: - if (toCheck->detection() == ToolChain::AutoDetectionFromSettings - && !Utils::anyOf(tcsToRegister, Utils::equal(&ToolChain::id, toCheck->id()))) - return true; - return false; - }); + // Remove TCs configured by the SDK: + foreach (ToolChain *tc, tcsToRegister) { + for (int i = tcsToCheck.count() - 1; i >= 0; --i) { + if (tcsToCheck.at(i)->id() == tc->id()) { + delete tcsToCheck.at(i); + tcsToCheck.removeAt(i); + } + } + } // Then auto detect QList detectedTcs;