diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index f5ceb1bb9f4..e3438ffb718 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -78,16 +78,22 @@ static QString CFStringRef2QString(CFStringRef s) namespace Ios { namespace Internal { -IosDevice::IosDevice() +IosDevice::IosDevice(CtorHelper) : m_lastPort(Constants::IOS_DEVICE_PORT_START) { - setupId(IDevice::AutoDetected, Constants::IOS_DEVICE_ID); setType(Constants::IOS_DEVICE_TYPE); setDefaultDisplayName(IosDevice::name()); setDisplayType(QCoreApplication::translate("Ios::Internal::IosDevice", "iOS")); setMachineType(IDevice::Hardware); setOsType(Utils::OsTypeMac); setDeviceState(DeviceDisconnected); +} + +IosDevice::IosDevice() + : IosDevice(CtorHelper{}) +{ + setupId(IDevice::AutoDetected, Constants::IOS_DEVICE_ID); + Utils::PortList ports; ports.addRange(Utils::Port(Constants::IOS_DEVICE_PORT_START), Utils::Port(Constants::IOS_DEVICE_PORT_END)); @@ -95,18 +101,11 @@ IosDevice::IosDevice() } IosDevice::IosDevice(const QString &uid) - : m_lastPort(Constants::IOS_DEVICE_PORT_START) + : IosDevice(CtorHelper{}) { setupId(IDevice::AutoDetected, Core::Id(Constants::IOS_DEVICE_ID).withSuffix(uid)); - setType(Constants::IOS_DEVICE_TYPE); - setDefaultDisplayName(IosDevice::name()); - setDisplayType(QCoreApplication::translate("Ios::Internal::IosDevice", "iOS")); - setMachineType(IDevice::Hardware); - setOsType(Utils::OsTypeMac); - setDeviceState(DeviceDisconnected); } - IDevice::DeviceInfo IosDevice::deviceInformation() const { IDevice::DeviceInfo res; diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h index 90588f65d9b..3370deb6207 100644 --- a/src/plugins/ios/iosdevice.h +++ b/src/plugins/ios/iosdevice.h @@ -68,6 +68,9 @@ protected: IosDevice(); IosDevice(const QString &uid); + enum CtorHelper {}; + IosDevice(CtorHelper); + Dict m_extraInfo; bool m_ignoreDevice = false; mutable quint16 m_lastPort;