diff options
author | Aurindam Jana <aurindam.jana@nokia.com> | 2011-09-21 16:39:45 +0200 |
---|---|---|
committer | Aurindam Jana <aurindam.jana@nokia.com> | 2011-09-22 12:27:38 +0200 |
commit | 43465cbe7a1fd5b055ce7930a46265972b77f9e1 (patch) | |
tree | 57a35648c1ca7a14718138ea2df30f00ceaee370 /src | |
parent | 97b4bcfa6c98a0a3a4dcc6dc6315513f27b7a976 (diff) | |
download | qt-creator-43465cbe7a1fd5b055ce7930a46265972b77f9e1.tar.gz |
Debugger: Show QML Script Console only for QML debugging
Change-Id: Ibb0f03c77a84ee8682d44944e8a24fac54cb60fe
Reviewed-on: http://codereview.qt-project.org/5329
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 13 | ||||
-rw-r--r-- | src/plugins/debugger/qml/qmlcppengine.cpp | 5 | ||||
-rw-r--r-- | src/plugins/debugger/qml/qmlcppengine.h | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 8b3cb80545..1f89c7615b 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -62,6 +62,8 @@ #include "watchwindow.h" #include "watchutils.h" #include "debuggertooltipmanager.h" +#include "qml/qmlengine.h" +#include "qml/qmlcppengine.h" #include "snapshothandler.h" #include "threadshandler.h" @@ -2230,7 +2232,16 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) || state == InferiorUnrunnable; setBusyCursor(!notbusy); - m_scriptConsoleWindow->setEnabled(stopped); + //Console should be enabled only for QML + QmlEngine *qmlEngine = qobject_cast<QmlEngine *>(engine); + QmlCppEngine *qmlCppEngine = qobject_cast<QmlCppEngine *>(engine); + if (qmlCppEngine) + qmlEngine = qobject_cast<QmlEngine *>(qmlCppEngine->qmlEngine()); + + if (qmlEngine) { + m_scriptConsoleWindow->setEnabled(stopped); + } + } void DebuggerPluginPrivate::updateDebugActions() diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp index ad86dc0209..0f06417e59 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -699,6 +699,11 @@ DebuggerEngine *QmlCppEngine::cppEngine() const return d->m_cppEngine; } +DebuggerEngine *QmlCppEngine::qmlEngine() const +{ + return d->m_qmlEngine; +} + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/qml/qmlcppengine.h b/src/plugins/debugger/qml/qmlcppengine.h index b63d837646..d7f462305a 100644 --- a/src/plugins/debugger/qml/qmlcppengine.h +++ b/src/plugins/debugger/qml/qmlcppengine.h @@ -87,6 +87,8 @@ public: const QString &expr, const QVariant &value); DebuggerEngine *cppEngine() const; + DebuggerEngine *qmlEngine() const; + void handleRemoteSetupDone(int gdbServerPort, int qmlPort); void handleRemoteSetupFailed(const QString &message); |