forked from qt-creator/qt-creator
ProjectExplorer: Fix UI of various kit aspects
... when there is no value compatible with the current build device.
The combo box was missing the "none" entry in that case.
Amends db11237dd5
.
Task-number: QTCREATORBUG-26870
Change-Id: I195b13026ac299d57287772040c1fc78ab9289d2
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -80,9 +80,7 @@ public:
|
||||
{
|
||||
clear();
|
||||
|
||||
const IDevice::ConstPtr dev = BuildDeviceKitAspect::device(&m_kit);
|
||||
if (!dev)
|
||||
return;
|
||||
if (const IDevice::ConstPtr dev = BuildDeviceKitAspect::device(&m_kit)) {
|
||||
const FilePath rootPath = dev->rootPath();
|
||||
const QList<CMakeTool *> toolsForBuildDevice
|
||||
= Utils::filtered(CMakeToolManager::cmakeTools(), [rootPath](CMakeTool *item) {
|
||||
@@ -90,6 +88,7 @@ public:
|
||||
});
|
||||
for (CMakeTool *item : toolsForBuildDevice)
|
||||
rootItem()->appendChild(new CMakeToolTreeItem(item, false));
|
||||
}
|
||||
rootItem()->appendChild(new CMakeToolTreeItem); // The "none" item.
|
||||
}
|
||||
|
||||
|
@@ -48,9 +48,7 @@ public:
|
||||
{
|
||||
clear();
|
||||
|
||||
const IDeviceConstPtr device = BuildDeviceKitAspect::device(&m_kit);
|
||||
if (!device)
|
||||
return;
|
||||
if (const IDeviceConstPtr device = BuildDeviceKitAspect::device(&m_kit)) {
|
||||
const Utils::FilePath rootPath = device->rootPath();
|
||||
const QList<DebuggerItem> debuggersForBuildDevice
|
||||
= Utils::filtered(DebuggerItemManager::debuggers(), [&](const DebuggerItem &item) {
|
||||
@@ -60,6 +58,7 @@ public:
|
||||
});
|
||||
for (const DebuggerItem &item : debuggersForBuildDevice)
|
||||
rootItem()->appendChild(new DebuggerTreeItem(item, false));
|
||||
}
|
||||
DebuggerItem noneItem;
|
||||
noneItem.setUnexpandedDisplayName(Tr::tr("None"));
|
||||
rootItem()->appendChild(new DebuggerTreeItem(noneItem, false));
|
||||
|
@@ -164,7 +164,10 @@ void KitAspect::refresh()
|
||||
la.spec.resetModel();
|
||||
la.comboBox->model()->sort(0);
|
||||
const QVariant itemId = la.spec.getter(*kit());
|
||||
la.comboBox->setCurrentIndex(la.comboBox->findData(itemId, IdRole));
|
||||
int idx = la.comboBox->findData(itemId, IdRole);
|
||||
if (idx == -1)
|
||||
idx = la.comboBox->count() - 1;
|
||||
la.comboBox->setCurrentIndex(idx);
|
||||
la.comboBox->setEnabled(!d->readOnly && la.comboBox->count() > 1);
|
||||
}
|
||||
}
|
||||
|
@@ -40,13 +40,10 @@ public:
|
||||
{
|
||||
clear();
|
||||
|
||||
if (const IDeviceConstPtr device = BuildDeviceKitAspect::device(&m_kit)) {
|
||||
const Toolchains ltcList = ToolchainManager::toolchains(
|
||||
[this](const Toolchain *tc) { return m_category.contains(tc->language()); });
|
||||
IDeviceConstPtr device = BuildDeviceKitAspect::device(&m_kit);
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
const QList<Toolchain *> toolchainsForBuildDevice
|
||||
const Toolchains toolchainsForBuildDevice
|
||||
= Utils::filtered(ltcList, [device](Toolchain *tc) {
|
||||
return tc->compilerCommand().isSameDevice(device->rootPath());
|
||||
});
|
||||
@@ -54,6 +51,7 @@ public:
|
||||
toolchainsForBuildDevice, ToolchainBundle::HandleMissing::CreateAndRegister);
|
||||
for (const ToolchainBundle &b : bundlesForBuildDevice)
|
||||
rootItem()->appendChild(new ToolchainTreeItem(b));
|
||||
}
|
||||
rootItem()->appendChild(new ToolchainTreeItem);
|
||||
}
|
||||
|
||||
|
@@ -49,9 +49,7 @@ public:
|
||||
{
|
||||
clear();
|
||||
|
||||
const IDevice::ConstPtr device = BuildDeviceKitAspect::device(&m_kit);
|
||||
if (!device)
|
||||
return;
|
||||
if (const IDevice::ConstPtr device = BuildDeviceKitAspect::device(&m_kit)) {
|
||||
const FilePath deviceRoot = device->rootPath();
|
||||
const QtVersions versionsForBuildDevice = QtVersionManager::versions(
|
||||
[&deviceRoot](const QtVersion *qt) {
|
||||
@@ -59,6 +57,7 @@ public:
|
||||
});
|
||||
for (QtVersion *v : versionsForBuildDevice)
|
||||
rootItem()->appendChild(new QtVersionItem(v->uniqueId()));
|
||||
}
|
||||
rootItem()->appendChild(new QtVersionItem(-1)); // The "No Qt" entry.
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user