From 7885bc899f8bd5952e23625dcf105b61bc1a1b38 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 9 Apr 2019 16:34:38 +0200 Subject: [PATCH] ProjectExplorer: Fix kit duplication in target setup page Do not add a modified kit to the UI if it was already present. Fixes: QTCREATORBUG-21240 Change-Id: Ib4887902402734ce95bde21c26ec9188ee9e55da Reviewed-by: Christian Stenger --- src/plugins/projectexplorer/targetsetuppage.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index aea75ad9932..501e0efc39a 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -382,6 +382,11 @@ void TargetSetupPage::handleKitUpdate(Kit *k) m_importer->makePersistent(k); bool acceptable = !m_requiredPredicate || m_requiredPredicate(k); + const bool wasAcceptable = Utils::contains(m_widgets, [k](const TargetSetupWidget *w) { + return w->kit() == k; + }); + if (acceptable == wasAcceptable) + return; if (!acceptable) removeWidget(k);