diff options
author | hjk <hjk@qt.io> | 2020-09-07 15:56:18 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-09-09 06:27:21 +0000 |
commit | 61bfd3243809b6a5e6cc77f49d96565dfb2d383e (patch) | |
tree | 545afe824bccb33510925d05353f1c8ddff9af8f /src/plugins/ios/iosrunconfiguration.cpp | |
parent | 552a1296fe75b130bcd0523075920428de2847b1 (diff) | |
download | qt-creator-61bfd3243809b6a5e6cc77f49d96565dfb2d383e.tar.gz |
ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places.
Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/ios/iosrunconfiguration.cpp')
-rw-r--r-- | src/plugins/ios/iosrunconfiguration.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index 83b46f6e52..dce03d37a5 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -131,7 +131,7 @@ void IosDeviceTypeAspect::deviceChanges() void IosDeviceTypeAspect::updateDeviceType() { - if (DeviceTypeKitAspect::deviceTypeId(m_runConfiguration->target()->kit()) + if (DeviceTypeKitAspect::deviceTypeId(m_runConfiguration->kit()) == Constants::IOS_DEVICE_TYPE) m_deviceType = IosDeviceType(IosDeviceType::IosDevice); else if (m_deviceType.type == IosDeviceType::IosDevice) @@ -140,11 +140,11 @@ void IosDeviceTypeAspect::updateDeviceType() bool IosRunConfiguration::isEnabled() const { - Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit()); + Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(kit()); if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE) return false; - IDevice::ConstPtr dev = DeviceKitAspect::device(target()->kit()); + IDevice::ConstPtr dev = DeviceKitAspect::device(kit()); if (dev.isNull() || dev->deviceState() != IDevice::DeviceReadyToUse) return false; @@ -153,8 +153,7 @@ bool IosRunConfiguration::isEnabled() const QString IosRunConfiguration::applicationName() const { - Project *project = target()->project(); - if (ProjectNode *node = project->findNodeForBuildKey(buildKey())) + if (ProjectNode *node = project()->findNodeForBuildKey(buildKey())) return node->data(Constants::IosTarget).toString(); return QString(); @@ -162,7 +161,7 @@ QString IosRunConfiguration::applicationName() const FilePath IosRunConfiguration::bundleDirectory() const { - Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit()); + Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(kit()); bool isDevice = (devType == Constants::IOS_DEVICE_TYPE); if (!isDevice && devType != Constants::IOS_SIMULATOR_TYPE) { qCWarning(iosLog) << "unexpected device type in bundleDirForTarget: " << devType.toString(); @@ -220,10 +219,10 @@ void IosDeviceTypeAspect::toMap(QVariantMap &map) const QString IosRunConfiguration::disabledReason() const { - Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit()); + Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(kit()); if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE) return tr("Kit has incorrect device type for running on iOS devices."); - IDevice::ConstPtr dev = DeviceKitAspect::device(target()->kit()); + IDevice::ConstPtr dev = DeviceKitAspect::device(kit()); QString validDevName; bool hasConncetedDev = false; if (devType == Constants::IOS_DEVICE_TYPE) { |