forked from qt-creator/qt-creator
ProjectExplorer: Do not auto-remove manually added toolchains
Fixes: QTCREATORBUG-22128 Change-Id: I73dff369542b6918bcb96fb7d028822e5aed2062 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/treemodel.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
@@ -84,17 +85,20 @@ public:
|
||||
if (column == 0)
|
||||
return toolChain->displayName();
|
||||
return toolChain->typeDisplayName();
|
||||
|
||||
case Qt::FontRole: {
|
||||
QFont font;
|
||||
font.setBold(changed);
|
||||
return font;
|
||||
}
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
if (!toolChain->isValid())
|
||||
return ToolChainOptionsPage::tr("This toolchain is no longer valid.");
|
||||
return ToolChainOptionsPage::tr("<nobr><b>ABI:</b> %1").arg(
|
||||
changed ? ToolChainOptionsPage::tr("not up-to-date")
|
||||
: toolChain->targetAbi().toString());
|
||||
case Qt::DecorationRole:
|
||||
return column == 0 && !toolChain->isValid()
|
||||
? Utils::Icons::CRITICAL.icon() : QVariant();
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
@@ -164,12 +164,9 @@ static ToolChainOperations mergeToolChainLists(const QList<ToolChain *> &systemF
|
||||
const QList<ToolChain *> notRedetectedButValidUserTcs
|
||||
= Utils::filtered(notRedetectedUserTcs, &ToolChain::isValid);
|
||||
|
||||
const QList<ToolChain *> validManualUserTcs
|
||||
= Utils::filtered(manualUserFileTcs, &ToolChain::isValid);
|
||||
|
||||
ToolChainOperations result;
|
||||
result.toDemote = notRedetectedButValidUserTcs;
|
||||
result.toRegister = stabilizeOrder(systemFileTcs + validManualUserTcs + result.toDemote // manual TCs
|
||||
result.toRegister = stabilizeOrder(systemFileTcs + manualUserFileTcs + result.toDemote // manual TCs
|
||||
+ redetectedUserTcs + newlyAutodetectedTcs, // auto TCs
|
||||
userFileTcs);
|
||||
|
||||
@@ -225,7 +222,7 @@ void ToolChainSettingsAccessor::saveToolChains(const QList<ToolChain *> &toolcha
|
||||
|
||||
int count = 0;
|
||||
for (const ToolChain *tc : toolchains) {
|
||||
if (!tc || !tc->isValid())
|
||||
if (!tc || (!tc->isValid() && tc->isAutoDetected()))
|
||||
continue;
|
||||
const QVariantMap tmp = tc->toMap();
|
||||
if (tmp.isEmpty())
|
||||
@@ -424,9 +421,9 @@ void ProjectExplorerPlugin::testToolChainMerging_data()
|
||||
<< (TCList()) << (TCList() << auto3i) << (TCList())
|
||||
<< (TCList()) << (TCList());
|
||||
|
||||
QTest::newRow("Delete invalid user")
|
||||
QTest::newRow("invalid user")
|
||||
<< (TCList()) << (TCList() << user3i) << (TCList())
|
||||
<< (TCList()) << (TCList());
|
||||
<< (TCList()) << (TCList{user3i});
|
||||
|
||||
QTest::newRow("one of everything")
|
||||
<< (TCList() << system1) << (TCList() << user1) << (TCList() << auto1)
|
||||
|
||||
Reference in New Issue
Block a user