RemoteLinux: Make sure there is a DebuggerRCAspect

Only offer to run runconfigs with the DebuggerRCAspect set, assert
that it is indeed there and never check for it again.

Change-Id: I5e9b329efb15d56ae221aed3ea2a75caa1078c18
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tobias Hunger
2016-12-05 15:19:55 +01:00
parent ce7e5e3b4d
commit 77b8198c2b

View File

@@ -70,6 +70,7 @@ bool RemoteLinuxRunControlFactory::canRun(RunConfiguration *runConfiguration, Co
}
const Core::Id id = runConfiguration->id();
QTC_ASSERT(runConfiguration->extraAspect<DebuggerRunConfigurationAspect>(), return false);
return runConfiguration->isEnabled()
&& (id == RemoteLinuxCustomRunConfiguration::runConfigId()
|| id.name().startsWith(RemoteLinuxRunConfiguration::IdPrefix));
@@ -96,7 +97,9 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Co
}
auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
int portsUsed = aspect ? aspect->portsUsedByDebugger() : 0;
QTC_ASSERT(aspect, return 0);
int portsUsed = aspect->portsUsedByDebugger();
if (portsUsed > dev->freePorts().count()) {
*errorMessage = tr("Cannot debug: Not enough free ports available.");
return 0;