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