ProjectExplorer: fix comparing toolchains on redetection

Use the specialized operator== of ToolChain when looking for priorly
defined autodetected tool chains.

Fixes: QTCREATORBUG-25697
Change-Id: I477d29695eef2acb1ba566d42df9b1e57d26eb07
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2021-10-21 12:59:53 +02:00
parent 75bdc64d44
commit 0a7935d449

View File

@@ -417,10 +417,7 @@ void ToolChainOptionsWidget::redetectToolchains()
if (knownTcs.contains(tc) || toDelete.contains(tc)) if (knownTcs.contains(tc) || toDelete.contains(tc))
continue; continue;
const auto matchItem = [tc](const ToolChainTreeItem *item) { const auto matchItem = [tc](const ToolChainTreeItem *item) {
return item->toolChain->compilerCommand() == tc->compilerCommand() return *item->toolChain == *tc;
&& item->toolChain->typeId() == tc->typeId()
&& item->toolChain->language() == tc->language()
&& item->toolChain->targetAbi() == tc->targetAbi();
}; };
ToolChainTreeItem * const item = findOrDefault(itemsToRemove, matchItem); ToolChainTreeItem * const item = findOrDefault(itemsToRemove, matchItem);
if (item) { if (item) {