QML Inspector: Disable debug actions when qml inspector is disabled

Reviewed-by: Thomas Hartmann
This commit is contained in:
Lasse Holmstedt
2010-07-29 16:58:12 +02:00
parent 4660ff4a04
commit 308b462973
3 changed files with 13 additions and 3 deletions

View File

@@ -37,7 +37,6 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/applicationlauncher.h>
#include <utils/qtcassert.h>
#include <debugger/debuggerconstants.h>
#include <debugger/debuggerconstants.h>
#include <debugger/debuggeruiswitcher.h>
@@ -147,8 +146,12 @@ QmlRunControlFactory::~QmlRunControlFactory()
bool QmlRunControlFactory::canRun(RunConfiguration *runConfiguration,
const QString &mode) const
{
Q_UNUSED(mode);
return (qobject_cast<QmlProjectRunConfiguration*>(runConfiguration) != 0);
QmlProjectRunConfiguration *config = qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
if (mode == ProjectExplorer::Constants::RUNMODE) {
return config != 0;
} else {
return (config != 0) && Debugger::DebuggerUISwitcher::instance()->supportedLanguages().contains(Qml::Constants::LANG_QML);
}
}
RunControl *QmlRunControlFactory::create(RunConfiguration *runConfiguration,