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;