diff --git a/src/plugins/ios/iosrunfactories.cpp b/src/plugins/ios/iosrunfactories.cpp index c4ad3fcafea..e9c82197842 100644 --- a/src/plugins/ios/iosrunfactories.cpp +++ b/src/plugins/ios/iosrunfactories.cpp @@ -157,26 +157,7 @@ bool IosRunControlFactory::canRun(RunConfiguration *runConfiguration, { if (mode != NormalRunMode && mode != DebugRunMode) return false; - IosRunConfiguration *rc = qobject_cast(runConfiguration); - if (!rc) - return false; - - IDevice::ConstPtr device = DeviceKitInformation::device(rc->target()->kit()); - if (!device || device->deviceState() != IDevice::DeviceReadyToUse) - return false; - - // The device can only run the same application once, any subsequent runs will - // not launch a second instance. Disable the Run button if the application is already - // running on the device. - if (m_activeRunControls.contains(device->id())) { - QPointer activeRunControl = m_activeRunControls[device->id()]; - if (activeRunControl && activeRunControl.data()->isRunning()) - return false; - else - m_activeRunControls.remove(device->id()); - } - - return rc; + return qobject_cast(runConfiguration); } RunControl *IosRunControlFactory::create(RunConfiguration *runConfig, @@ -185,15 +166,10 @@ RunControl *IosRunControlFactory::create(RunConfiguration *runConfig, Q_ASSERT(canRun(runConfig, mode)); IosRunConfiguration *rc = qobject_cast(runConfig); Q_ASSERT(rc); - RunControl *res = 0; if (mode == NormalRunMode) - res = new Ios::Internal::IosRunControl(rc); + return new Ios::Internal::IosRunControl(rc); else - res = IosDebugSupport::createDebugRunControl(rc, errorMessage); - IDevice::ConstPtr device = DeviceKitInformation::device(rc->target()->kit()); - if (device) - m_activeRunControls[device->id()] = res; - return res; + return IosDebugSupport::createDebugRunControl(rc, errorMessage); } } // namespace Internal diff --git a/src/plugins/ios/iosrunfactories.h b/src/plugins/ios/iosrunfactories.h index bf6272fea91..8f4641c331c 100644 --- a/src/plugins/ios/iosrunfactories.h +++ b/src/plugins/ios/iosrunfactories.h @@ -83,8 +83,6 @@ public: ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, QString *errorMessage) QTC_OVERRIDE; -private: - mutable QMap > m_activeRunControls; }; } // namespace Internal