From c44043188c13cbbd428003dae492ef924b984427 Mon Sep 17 00:00:00 2001
From: Lasse Holmstedt <lasse.holmstedt@nokia.com>
Date: Wed, 24 Feb 2010 11:30:32 +0100
Subject: [PATCH] Fixed qml inspector to work when debugging qml projects

---
 src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
index b4bc07c2eb9..b947d6a8604 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
+++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
@@ -37,6 +37,10 @@
 #include <projectexplorer/applicationlauncher.h>
 #include <utils/qtcassert.h>
 
+#include <debugger/debuggerconstants.h>
+#include <debugger/debuggeruiswitcher.h>
+#include <qmlinspector/qmlinspectorconstants.h>
+
 #include <QDir>
 #include <QLabel>
 
@@ -77,6 +81,9 @@ void QmlRunControl::start()
 {
     m_applicationLauncher.start(ProjectExplorer::ApplicationLauncher::Gui, m_executable,
                                 m_commandLineArguments);
+
+    Debugger::DebuggerUISwitcher::instance()->setActiveLanguage(Qml::Constants::LANG_QML);
+
     emit started();
     emit addToOutputWindow(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable),
                            m_commandLineArguments.join(QLatin1String(" "))));
@@ -107,7 +114,7 @@ void QmlRunControl::slotAddToOutputWindow(const QString &line)
 {
     if (m_debugMode && line.startsWith("QmlDebugServer: Waiting for connection")) {
         Core::ICore *core = Core::ICore::instance();
-        core->modeManager()->activateMode(QLatin1String("QML_INSPECT_MODE"));
+        core->modeManager()->activateMode(Debugger::Constants::MODE_DEBUG);
     }
 
     emit addToOutputWindowInline(this, line);
-- 
GitLab