RemoteLinux: Move portsUsedByDebugger() to DebuggerRunConfigurationAspect

Change-Id: I0add29c3c69c4ba59cea159f32ca74be58bcee59
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
hjk
2016-01-26 14:09:13 +01:00
parent 9a3b340c00
commit 403fe30a30
6 changed files with 23 additions and 19 deletions

View File

@@ -105,14 +105,17 @@ bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id m
return false;
}
const QnxRunConfiguration * const rc = qobject_cast<QnxRunConfiguration *>(runConfiguration);
const QnxDeviceConfiguration::ConstPtr dev = DeviceKitInformation::device(runConfiguration->target()->kit())
.dynamicCast<const QnxDeviceConfiguration>();
if (dev.isNull())
return false;
if (mode == ProjectExplorer::Constants::DEBUG_RUN_MODE || mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE)
return rc->portsUsedByDebuggers() <= dev->freePorts().count();
if (mode == ProjectExplorer::Constants::DEBUG_RUN_MODE
|| mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
auto aspect = runConfiguration->extraAspect<DebuggerRunConfigurationAspect>();
int portsUsed = aspect ? aspect->portsUsedByDebugger() : 0;
return portsUsed <= dev->freePorts().count();
}
return true;
}