Project: Base IDevice on AspectContainer

This is effectively the same approach as taken with ProjectConfiguration.

Having the settings separate leads to quite some boilerplate and in the
end to parallel IDevice and DeviceSettings hierarchies.

The unusual registration of the docker aspects are due to the multiple
inheritance, we need to "dynamic" downcast.

Change-Id: I50864e2009f4e525d635decf1c9beaad5e6a5f1f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2024-08-01 12:30:23 +02:00
parent e78da3dfee
commit 2a7bf0fdaf
21 changed files with 229 additions and 296 deletions

View File

@@ -107,7 +107,7 @@ IosDevice::IosDevice(CtorHelper)
: m_lastPort(Constants::IOS_DEVICE_PORT_START)
{
setType(Constants::IOS_DEVICE_TYPE);
settings()->displayName.setDefaultValue(IosDevice::name());
displayName.setDefaultValue(IosDevice::name());
setDisplayType(Tr::tr("iOS"));
setMachineType(IDevice::Hardware);
setOsType(Utils::OsTypeMac);
@@ -248,7 +248,7 @@ void IosDeviceManager::deviceConnected(const QString &uid, const QString &name)
if (!dev) {
auto newDev = new IosDevice(uid);
if (!name.isNull())
newDev->settings()->displayName.setValue(name);
newDev->displayName.setValue(name);
qCDebug(detectLog) << "adding ios device " << uid;
devManager->addDevice(IDevice::ConstPtr(newDev));
} else if (dev->deviceState() != IDevice::DeviceConnected &&
@@ -364,7 +364,7 @@ void IosDeviceManager::deviceInfo(const QString &uid,
}
if (!skipUpdate) {
if (info.contains(kDeviceName))
newDev->settings()->displayName.setValue(info.value(kDeviceName));
newDev->displayName.setValue(info.value(kDeviceName));
newDev->m_extraInfo = info;
newDev->m_handler = handler;
qCDebug(detectLog) << "updated info of ios device " << uid;

View File

@@ -28,7 +28,7 @@ IosSimulator::IosSimulator(Id id)
setType(Constants::IOS_SIMULATOR_TYPE);
setMachineType(IDevice::Emulator);
setOsType(Utils::OsTypeMac);
settings()->displayName.setDefaultValue(Tr::tr("iOS Simulator"));
displayName.setDefaultValue(Tr::tr("iOS Simulator"));
setDisplayType(Tr::tr("iOS Simulator"));
setDeviceState(DeviceStateUnknown);
}