forked from qt-creator/qt-creator
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:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user