From e778283b080047e79aa95240cf4bbc7ab77659a7 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 8 Sep 2020 11:22:11 +0200 Subject: [PATCH] ProjectExplorer: Filter out non-applicable toolchains ... when filling the "parent toolchain" combo box for clang on Windows. We should not offer the user a mingw C compiler as the parent of a clang C++ compiler. Even though it will probably work (as it's mainly there for the sysroot), it's conceptually weird and it blows up the number of entries for no good reason. Change-Id: Ic920993b4ff36f8d8d095392555dc9d27f376878 Reviewed-by: Orgad Shaneh --- src/plugins/projectexplorer/gcctoolchain.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index e4ea036d77f..2a7a820e17e 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1720,8 +1720,11 @@ void ClangToolChainConfigWidget::updateParentToolChainComboBox() return; for (const ToolChain *mingwTC : mingwToolChains()) { - if (parentId != mingwTC->id()) - m_parentToolchainCombo->addItem(mingwTC->displayName(), mingwTC->id()); + if (mingwTC->id() == parentId) + continue; + if (mingwTC->language() != tc->language()) + continue; + m_parentToolchainCombo->addItem(mingwTC->displayName(), mingwTC->id()); } }