forked from qt-creator/qt-creator
ProjectExplorer: Add convenience method ToolChain::isSdkProvided()
Change-Id: I4f8bfcfbd5baef8210a41f6ccc878b0454e4697b Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -100,6 +100,7 @@ public:
|
||||
void setDisplayName(const QString &name);
|
||||
|
||||
bool isAutoDetected() const;
|
||||
bool isSdkProvided() const { return detection() == AutoDetectionFromSdk; }
|
||||
Detection detection() const;
|
||||
QString detectionSource() const;
|
||||
|
||||
|
@@ -222,7 +222,7 @@ public:
|
||||
if (item->level() != 3)
|
||||
return;
|
||||
const auto tcItem = static_cast<ToolChainTreeItem *>(item);
|
||||
if (tcItem->toolChain->detection() != ToolChain::AutoDetectionFromSdk)
|
||||
if (!tcItem->toolChain->isSdkProvided())
|
||||
itemsToRemove << tcItem;
|
||||
});
|
||||
for (ToolChainTreeItem * const tcItem : qAsConst(itemsToRemove))
|
||||
@@ -403,12 +403,10 @@ void ToolChainOptionsWidget::redetectToolchains()
|
||||
if (item->level() != 3)
|
||||
return;
|
||||
const auto tcItem = static_cast<ToolChainTreeItem *>(item);
|
||||
if (tcItem->toolChain->isAutoDetected()
|
||||
&& tcItem->toolChain->detection() != ToolChain::AutoDetectionFromSdk) {
|
||||
if (tcItem->toolChain->isAutoDetected() && !tcItem->toolChain->isSdkProvided())
|
||||
itemsToRemove << tcItem;
|
||||
} else {
|
||||
else
|
||||
knownTcs << tcItem->toolChain;
|
||||
}
|
||||
});
|
||||
Toolchains toAdd;
|
||||
QSet<ToolChain *> toDelete;
|
||||
@@ -551,7 +549,7 @@ void ToolChainOptionsWidget::updateState()
|
||||
if (ToolChainTreeItem *item = currentTreeItem()) {
|
||||
ToolChain *tc = item->toolChain;
|
||||
canCopy = tc->isValid();
|
||||
canDelete = tc->detection() != ToolChain::AutoDetectionFromSdk;
|
||||
canDelete = !tc->isSdkProvided();
|
||||
}
|
||||
|
||||
m_cloneButton->setEnabled(canCopy);
|
||||
|
Reference in New Issue
Block a user