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 <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2019-04-09 16:34:38 +02:00
parent 0a8a9f60e1
commit 7885bc899f

View File

@@ -382,6 +382,11 @@ void TargetSetupPage::handleKitUpdate(Kit *k)
m_importer->makePersistent(k); m_importer->makePersistent(k);
bool acceptable = !m_requiredPredicate || m_requiredPredicate(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) if (!acceptable)
removeWidget(k); removeWidget(k);