forked from qt-creator/qt-creator
iOS: Dissolve IosRunControlFactory
Follows suite. Change-Id: I2ef11d19d9a2d3d0f3f282a94f98a40478273fbc Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
@@ -74,9 +74,29 @@ using namespace Utils;
|
||||
namespace Ios {
|
||||
namespace Internal {
|
||||
|
||||
static void stopRunningRunControl(RunControl *runControl)
|
||||
{
|
||||
static QMap<Core::Id, QPointer<RunControl>> activeRunControls;
|
||||
|
||||
RunConfiguration *runConfig = runControl->runConfiguration();
|
||||
Target *target = runConfig->target();
|
||||
Core::Id devId = DeviceKitInformation::deviceId(target->kit());
|
||||
|
||||
// The device can only run an application at a time, if an app is running stop it.
|
||||
if (activeRunControls.contains(devId)) {
|
||||
if (QPointer<RunControl> activeRunControl = activeRunControls[devId])
|
||||
activeRunControl->initiateStop();
|
||||
activeRunControls.remove(devId);
|
||||
}
|
||||
|
||||
if (devId.isValid())
|
||||
activeRunControls[devId] = runControl;
|
||||
}
|
||||
|
||||
IosRunner::IosRunner(RunControl *runControl)
|
||||
: RunWorker(runControl)
|
||||
{
|
||||
stopRunningRunControl(runControl);
|
||||
auto runConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
|
||||
m_bundleDir = runConfig->bundleDirectory().toString();
|
||||
m_arguments = QStringList(runConfig->commandLineArguments());
|
||||
|
||||
Reference in New Issue
Block a user