OSDN Git Service

Debugger: Show QML Script Console only for QML debugging
authorAurindam Jana <aurindam.jana@nokia.com>
Wed, 21 Sep 2011 14:39:45 +0000 (16:39 +0200)
committerAurindam Jana <aurindam.jana@nokia.com>
Thu, 22 Sep 2011 10:27:38 +0000 (12:27 +0200)
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>
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/qml/qmlcppengine.cpp
src/plugins/debugger/qml/qmlcppengine.h

index 8b3cb80..1f89c76 100644 (file)
@@ -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()
index ad86dc0..0f06417 100644 (file)
@@ -699,6 +699,11 @@ DebuggerEngine *QmlCppEngine::cppEngine() const
     return d->m_cppEngine;
 }
 
+DebuggerEngine *QmlCppEngine::qmlEngine() const
+{
+    return d->m_qmlEngine;
+}
+
 } // namespace Internal
 } // namespace Debugger
 
index b63d837..d7f4623 100644 (file)
@@ -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);