ProjectExplorer: Paddle back on IDevice aspect exposure

Make the aspects private, but provide accessors to value and
defaultValue as needed. This allows setters to be kept protected
when wanted.

Change-Id: I26f93f62d4ac2e7346f95543c38d8ac9156348c2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2024-08-05 18:04:12 +02:00
parent 32505b21c8
commit e88f65866c
19 changed files with 99 additions and 38 deletions

View File

@@ -107,7 +107,7 @@ IosDevice::IosDevice(CtorHelper)
: m_lastPort(Constants::IOS_DEVICE_PORT_START)
{
setType(Constants::IOS_DEVICE_TYPE);
displayName.setDefaultValue(IosDevice::name());
setDefaultDisplayName(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->displayName.setValue(name);
newDev->setDisplayName(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->displayName.setValue(info.value(kDeviceName));
newDev->setDisplayName(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);
displayName.setDefaultValue(Tr::tr("iOS Simulator"));
setDefaultDisplayName(Tr::tr("iOS Simulator"));
setDisplayType(Tr::tr("iOS Simulator"));
setDeviceState(DeviceStateUnknown);
}