forked from qt-creator/qt-creator
iOS: Modernize
modernize-* Change-Id: I64d2bb4320c9b444bc13e90099600628eac1f5a6 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -93,10 +93,7 @@ IosDevice::IosDevice()
|
||||
setFreePorts(ports);
|
||||
}
|
||||
|
||||
IosDevice::IosDevice(const IosDevice &other)
|
||||
: IDevice(other), m_extraInfo(other.m_extraInfo), m_ignoreDevice(other.m_ignoreDevice),
|
||||
m_lastPort(other.m_lastPort)
|
||||
{ }
|
||||
IosDevice::IosDevice(const IosDevice &other) = default;
|
||||
|
||||
IosDevice::IosDevice(const QString &uid)
|
||||
: IDevice(Core::Id(Constants::IOS_DEVICE_TYPE),
|
||||
@@ -130,7 +127,7 @@ QString IosDevice::displayType() const
|
||||
|
||||
IDeviceWidget *IosDevice::createWidget()
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<Core::Id> IosDevice::actionIds() const
|
||||
@@ -223,7 +220,7 @@ Utils::OsType IosDevice::osType() const
|
||||
|
||||
IosDeviceManager::TranslationMap IosDeviceManager::translationMap()
|
||||
{
|
||||
static TranslationMap *translationMap = 0;
|
||||
static TranslationMap *translationMap = nullptr;
|
||||
if (translationMap)
|
||||
return *translationMap;
|
||||
TranslationMap &tMap = *new TranslationMap;
|
||||
@@ -248,7 +245,7 @@ void IosDeviceManager::deviceConnected(const QString &uid, const QString &name)
|
||||
Core::Id devId = baseDevId.withSuffix(uid);
|
||||
IDevice::ConstPtr dev = devManager->find(devId);
|
||||
if (dev.isNull()) {
|
||||
IosDevice *newDev = new IosDevice(uid);
|
||||
auto newDev = new IosDevice(uid);
|
||||
if (!name.isNull())
|
||||
newDev->setDisplayName(name);
|
||||
qCDebug(detectLog) << "adding ios device " << uid;
|
||||
@@ -256,9 +253,9 @@ void IosDeviceManager::deviceConnected(const QString &uid, const QString &name)
|
||||
} else if (dev->deviceState() != IDevice::DeviceConnected &&
|
||||
dev->deviceState() != IDevice::DeviceReadyToUse) {
|
||||
qCDebug(detectLog) << "updating ios device " << uid;
|
||||
IosDevice *newDev = 0;
|
||||
IosDevice *newDev = nullptr;
|
||||
if (dev->type() == devType) {
|
||||
const IosDevice *iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
auto iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
newDev = new IosDevice(*iosDev);
|
||||
} else {
|
||||
newDev = new IosDevice(uid);
|
||||
@@ -279,7 +276,7 @@ void IosDeviceManager::deviceDisconnected(const QString &uid)
|
||||
if (dev.isNull() || dev->type() != devType) {
|
||||
qCWarning(detectLog) << "ignoring disconnection of ios device " << uid; // should neve happen
|
||||
} else {
|
||||
const IosDevice *iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
auto iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
if (iosDev->m_extraInfo.isEmpty()
|
||||
|| iosDev->m_extraInfo.value(QLatin1String("deviceName")) == QLatin1String("*unknown*")) {
|
||||
devManager->removeDevice(iosDev->id());
|
||||
@@ -309,9 +306,9 @@ void IosDeviceManager::deviceInfo(IosToolHandler *, const QString &uid,
|
||||
Core::Id devId = baseDevId.withSuffix(uid);
|
||||
IDevice::ConstPtr dev = devManager->find(devId);
|
||||
bool skipUpdate = false;
|
||||
IosDevice *newDev = 0;
|
||||
IosDevice *newDev = nullptr;
|
||||
if (!dev.isNull() && dev->type() == devType) {
|
||||
const IosDevice *iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
auto iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
if (iosDev->m_extraInfo == info) {
|
||||
skipUpdate = true;
|
||||
newDev = const_cast<IosDevice *>(iosDev);
|
||||
@@ -550,7 +547,7 @@ void IosDeviceManager::updateAvailableDevices(const QStringList &devices)
|
||||
Core::Id devType(Constants::IOS_DEVICE_TYPE);
|
||||
if (dev.isNull() || dev->type() != devType)
|
||||
continue;
|
||||
const IosDevice *iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
auto iosDev = static_cast<const IosDevice *>(dev.data());
|
||||
if (devices.contains(iosDev->uniqueDeviceID()))
|
||||
continue;
|
||||
if (iosDev->deviceState() != IDevice::DeviceDisconnected) {
|
||||
|
||||
Reference in New Issue
Block a user