Skip to content
Snippets Groups Projects
Commit d880f050 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Don't allow run control to be created for invalid run config.

parent 7a8b5979
No related branches found
No related tags found
No related merge requests found
...@@ -163,7 +163,8 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration, ...@@ -163,7 +163,8 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration,
const MaemoRunConfiguration * const maemoRunConfig const MaemoRunConfiguration * const maemoRunConfig
= qobject_cast<MaemoRunConfiguration *>(runConfiguration); = qobject_cast<MaemoRunConfiguration *>(runConfiguration);
if (!maemoRunConfig || !maemoRunConfig->deviceConfig().isValid() if (!maemoRunConfig || !maemoRunConfig->deviceConfig().isValid()
|| !maemoRunConfig->toolchain()) || !maemoRunConfig->toolchain()
|| maemoRunConfig->remoteExecutableFilePath().isEmpty())
return false; return false;
const int freePortCount = maemoRunConfig->freePorts().count(); const int freePortCount = maemoRunConfig->freePorts().count();
if (freePortCount == 0) if (freePortCount == 0)
...@@ -182,10 +183,11 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration, ...@@ -182,10 +183,11 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration,
RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig,
const QString &mode) const QString &mode)
{ {
MaemoRunConfiguration *rc = qobject_cast<MaemoRunConfiguration *>(runConfig);
Q_ASSERT(rc);
Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE
|| mode == ProjectExplorer::Constants::DEBUGMODE); || mode == ProjectExplorer::Constants::DEBUGMODE);
Q_ASSERT(canRun(runConfig, mode));
MaemoRunConfiguration *rc = qobject_cast<MaemoRunConfiguration *>(runConfig);
Q_ASSERT(rc);
if (mode == ProjectExplorer::Constants::RUNMODE) if (mode == ProjectExplorer::Constants::RUNMODE)
return new MaemoRunControl(rc); return new MaemoRunControl(rc);
return MaemoDebugSupport::createDebugRunControl(rc); return MaemoDebugSupport::createDebugRunControl(rc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment