diff options
author | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2010-07-29 16:58:12 +0200 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2010-07-29 17:04:56 +0200 |
commit | 66750de6af6d67ec50297c2a4dd7b844d890a809 (patch) | |
tree | 60ead9849973ef39d3a3288dbeb0db3b53588f56 | |
parent | fd42489296ab416a6cd74c619b0928db934db1bf (diff) | |
download | qt-creator-66750de6af6d67ec50297c2a4dd7b844d890a809.tar.gz |
QML Inspector: Disable debug actions when qml inspector is disabled
Reviewed-by: Thomas Hartmann
(cherry picked from commit 308b462973bf90802d28bc946176f526f5bd302a)
-rw-r--r-- | src/plugins/debugger/debuggeruiswitcher.cpp | 5 | ||||
-rw-r--r-- | src/plugins/debugger/debuggeruiswitcher.h | 2 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp | 9 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/debugger/debuggeruiswitcher.cpp b/src/plugins/debugger/debuggeruiswitcher.cpp index a7db1101a7..2c9b2237e2 100644 --- a/src/plugins/debugger/debuggeruiswitcher.cpp +++ b/src/plugins/debugger/debuggeruiswitcher.cpp @@ -153,6 +153,11 @@ DebuggerUISwitcher::~DebuggerUISwitcher() delete d; } +QStringList DebuggerUISwitcher::supportedLanguages() const +{ + return d->m_languages; +} + void DebuggerUISwitcher::addMenuAction(Core::Command *command, const QString &langName, const QString &group) { diff --git a/src/plugins/debugger/debuggeruiswitcher.h b/src/plugins/debugger/debuggeruiswitcher.h index 52a4e1cb3a..522d5fd61a 100644 --- a/src/plugins/debugger/debuggeruiswitcher.h +++ b/src/plugins/debugger/debuggeruiswitcher.h @@ -77,6 +77,8 @@ public: void addMenuAction(Core::Command *command, const QString &langName, const QString &group = QString()); + QStringList supportedLanguages() const; + // Changes the active language UI to the one specified by langName. // Does nothing if automatic switching is toggled off from settings. void setActiveLanguage(const QString &langName); diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index de6e9bba30..3307df5b4c 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -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, |