forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/13.0'
Change-Id: I0892d8e54930bb5a65dc51117b8ca7d70ce300a3
This commit is contained in:
@@ -60,18 +60,29 @@ using namespace Tasking;
|
||||
|
||||
namespace Ios::Internal {
|
||||
|
||||
static QString identifierForRunControl(RunControl *runControl)
|
||||
{
|
||||
const IosDeviceTypeAspect::Data *data = runControl->aspectData<IosDeviceTypeAspect>();
|
||||
return data ? data->deviceType.identifier : QString();
|
||||
}
|
||||
|
||||
static void stopRunningRunControl(RunControl *runControl)
|
||||
{
|
||||
static QMap<Id, QPointer<RunControl>> activeRunControls;
|
||||
|
||||
// clean up deleted
|
||||
Utils::erase(activeRunControls, [](const QPointer<RunControl> &rc) { return !rc; });
|
||||
|
||||
Target *target = runControl->target();
|
||||
Id devId = DeviceKitAspect::deviceId(target->kit());
|
||||
const Id devId = DeviceKitAspect::deviceId(target->kit());
|
||||
const QString identifier = identifierForRunControl(runControl);
|
||||
|
||||
// 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])
|
||||
if (QPointer<RunControl> activeRunControl = activeRunControls[devId]) {
|
||||
if (identifierForRunControl(activeRunControl) == identifier) {
|
||||
activeRunControl->initiateStop();
|
||||
activeRunControls.remove(devId);
|
||||
activeRunControls.remove(devId);
|
||||
}
|
||||
}
|
||||
|
||||
if (devId.isValid())
|
||||
|
||||
Reference in New Issue
Block a user