ProjectExplorer: Make DeviceKitAspect mutable for all non-Desktop kits

Fixes: QTCREATORBUG-30031
Change-Id: I0b2dacb5977b0f8e81afd13a0a4af6354ea81915
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2023-12-13 12:34:15 +01:00
parent 3425959e21
commit 368ad63653
5 changed files with 4 additions and 3 deletions

View File

@@ -1404,7 +1404,6 @@ void AndroidConfigurations::updateAutomaticKitList()
BuildDeviceKitAspect::setDeviceId(k, DeviceManager::defaultDesktopDevice()->id()); BuildDeviceKitAspect::setDeviceId(k, DeviceManager::defaultDesktopDevice()->id());
k->setSticky(QtKitAspect::id(), true); k->setSticky(QtKitAspect::id(), true);
k->setMutable(DeviceKitAspect::id(), true);
k->setSticky(DeviceTypeKitAspect::id(), true); k->setSticky(DeviceTypeKitAspect::id(), true);
QString versionStr = QLatin1String("Qt %{Qt:Version}"); QString versionStr = QLatin1String("Qt %{Qt:Version}");

View File

@@ -188,7 +188,6 @@ static void setupKit(Kit *kit, Id pDeviceType, const ToolChainPair& toolChains,
&& debuggerId.isValid()) && debuggerId.isValid())
DebuggerKitAspect::setDebugger(kit, debuggerId); DebuggerKitAspect::setDebugger(kit, debuggerId);
kit->setMutable(DeviceKitAspect::id(), true);
kit->setSticky(QtKitAspect::id(), true); kit->setSticky(QtKitAspect::id(), true);
kit->setSticky(ToolchainKitAspect::id(), true); kit->setSticky(ToolchainKitAspect::id(), true);
kit->setSticky(DeviceTypeKitAspect::id(), true); kit->setSticky(DeviceTypeKitAspect::id(), true);

View File

@@ -674,6 +674,8 @@ void Kit::setMutable(Id id, bool b)
bool Kit::isMutable(Id id) const bool Kit::isMutable(Id id) const
{ {
if (id == DeviceKitAspect::id())
return DeviceTypeKitAspect::deviceTypeId(this) != Constants::DESKTOP_DEVICE_TYPE;
return d->m_mutable.contains(id); return d->m_mutable.contains(id);
} }

View File

@@ -806,6 +806,8 @@ void KitAspect::addToLayout(Layouting::LayoutItem &parentItem)
void KitAspect::addMutableAction(QWidget *child) void KitAspect::addMutableAction(QWidget *child)
{ {
QTC_ASSERT(child, return); QTC_ASSERT(child, return);
if (factory()->id() == DeviceKitAspect::id())
return;
child->addAction(m_mutableAction); child->addAction(m_mutableAction);
child->setContextMenuPolicy(Qt::ActionsContextMenu); child->setContextMenuPolicy(Qt::ActionsContextMenu);
} }

View File

@@ -273,7 +273,6 @@ void QnxConfiguration::createKit(const QnxTarget &target)
k->setAutoDetected(false); k->setAutoDetected(false);
k->setAutoDetectionSource(m_envFile.toString()); k->setAutoDetectionSource(m_envFile.toString());
k->setMutable(DeviceKitAspect::id(), true);
k->setSticky(ToolchainKitAspect::id(), true); k->setSticky(ToolchainKitAspect::id(), true);
k->setSticky(DeviceTypeKitAspect::id(), true); k->setSticky(DeviceTypeKitAspect::id(), true);