Commit 22c0f6ae authored by Daniel Teske's avatar Daniel Teske
Browse files

QmlRunControlFactory: Cleaner canRun code

Fixed a bug where the case config->qtVersion == 0 was mishandled.

Change-Id: Ic11133bcfbe402e8f7a19b99b59161f8a913a2ab
Reviewed-on: http://codereview.qt.nokia.com/1779

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarChristiaan Janssen <christiaan.janssen@nokia.com>
parent ddeef631
......@@ -151,22 +151,24 @@ bool QmlProjectRunControlFactory::canRun(RunConfiguration *runConfiguration,
{
QmlProjectRunConfiguration *config =
qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
if (!config)
return false;
if (mode == ProjectExplorer::Constants::RUNMODE)
return config != 0 && !config->viewerPath().isEmpty();
else if (mode != Debugger::Constants::DEBUGMODE)
return !config->viewerPath().isEmpty();
if (mode != Debugger::Constants::DEBUGMODE)
return false;
bool qmlDebugSupportInstalled =
Debugger::DebuggerPlugin::isActiveDebugLanguage(Debugger::QmlLanguage);
if (config && qmlDebugSupportInstalled) {
if (!(config->qtVersion() && config->qtVersion()->needsQmlDebuggingLibrary())
|| !config->observerPath().isEmpty())
return true;
if (config->qtVersion() && QtSupport::QmlObserverTool::canBuild(config->qtVersion()))
return true;
}
if (!Debugger::DebuggerPlugin::isActiveDebugLanguage(Debugger::QmlLanguage))
return false;
if (!config->observerPath().isEmpty())
return true;
if (!config->qtVersion())
return false;
if (!config->qtVersion()->needsQmlDebuggingLibrary())
return true;
if (QtSupport::QmlObserverTool::canBuild(config->qtVersion()))
return true;
return false;
}
......
Supports Markdown
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