From c4ab8909979f0acce65a89e0626942db76381822 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Fri, 14 Feb 2014 00:48:40 +0100 Subject: [PATCH] ios: cache app path in deploy step avoid accessing target and runconfig in the run method Change-Id: I2d48ade1313d80e8041ea90f59f53f93858ab6b3 Reviewed-by: Daniel Teske --- src/plugins/ios/iosdeploystep.cpp | 8 +++++--- src/plugins/ios/iosdeploystep.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index 9b0e0019546..2fb22655b6a 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -86,6 +86,10 @@ bool IosDeployStep::init() { QTC_CHECK(m_transferStatus == NoTransfer); m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit()); + IosRunConfiguration * runConfig = qobject_cast( + this->target()->activeRunConfiguration()); + QTC_CHECK(runConfig); + m_bundlePath = runConfig->bundleDir().toString(); if (m_device.isNull()) { emit addOutput(tr("Error: no device available, deploy failed."), BuildStep::ErrorMessageOutput); @@ -219,9 +223,7 @@ QString IosDeployStep::deviceId() const QString IosDeployStep::appBundle() const { - IosRunConfiguration * runConfig = qobject_cast( - this->target()->activeRunConfiguration()); - return runConfig->bundleDir().toString(); + return m_bundlePath; } void IosDeployStep::raiseError(const QString &errorString) diff --git a/src/plugins/ios/iosdeploystep.h b/src/plugins/ios/iosdeploystep.h index 41a5d80d817..b61f96cc307 100644 --- a/src/plugins/ios/iosdeploystep.h +++ b/src/plugins/ios/iosdeploystep.h @@ -108,6 +108,7 @@ private: IosToolHandler *m_toolHandler; QFutureInterface m_futureInterface; ProjectExplorer::IDevice::ConstPtr m_device; + QString m_bundlePath; static const Core::Id Id; };