From d880f0501a12b7f848f763b25681afd190d20018 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 28 Sep 2010 09:51:16 +0200 Subject: [PATCH] Maemo: Don't allow run control to be created for invalid run config. --- .../qt4projectmanager/qt-maemo/maemorunfactories.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp index 0ee8512d1d3..49c42bef3c3 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp @@ -163,7 +163,8 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration, const MaemoRunConfiguration * const maemoRunConfig = qobject_cast(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(runConfig); - Q_ASSERT(rc); Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE || mode == ProjectExplorer::Constants::DEBUGMODE); + Q_ASSERT(canRun(runConfig, mode)); + MaemoRunConfiguration *rc = qobject_cast(runConfig); + Q_ASSERT(rc); if (mode == ProjectExplorer::Constants::RUNMODE) return new MaemoRunControl(rc); return MaemoDebugSupport::createDebugRunControl(rc);