From 1835c9db6723d62a89f48f60bc343406b15d75a3 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 27 Sep 2024 15:34:37 +0200 Subject: [PATCH] ProjectExplorer: Fix re-detection of mingw toolchains After restarting Qt Creator, auto-detected mingw toolchains were demoted to manual toolchains. Change-Id: Ie30185c0265849c4812dc060f19edea47900a7d1 Reviewed-by: hjk --- src/plugins/projectexplorer/gcctoolchain.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 0d19c0a8968..ee11fe7a52a 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1668,7 +1668,13 @@ Toolchains GccToolchainFactory::autoDetectToolchains(const FilePaths &compilerPa } } if (existingTcMatches) { - if (existingTc->typeId() == requiredTypeId && !result.contains(existingTc)) + // We call this function only once for GCC and MinGW with required type + // GCC_TOOLCHAIN_TYPEID. + const bool typeMatches = existingTc->typeId() == requiredTypeId + || (existingTc->typeId() + == Constants::MINGW_TOOLCHAIN_TYPEID + && requiredTypeId == Constants::GCC_TOOLCHAIN_TYPEID); + if (typeMatches && !result.contains(existingTc)) result << existingTc; alreadyExists = true; }