From 0a85b90d98cebe772ee187896219c9552b5c67c9 Mon Sep 17 00:00:00 2001
From: Lasse Holmstedt <lasse.holmstedt@nokia.com>
Date: Wed, 25 Aug 2010 09:46:00 +0200
Subject: [PATCH] Debugger UI: Don't check "C++" language if active project is
 .qmlproject

---
 src/plugins/debugger/debuggeruiswitcher.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/plugins/debugger/debuggeruiswitcher.cpp b/src/plugins/debugger/debuggeruiswitcher.cpp
index 31a816b034b..f8dbcfb2536 100644
--- a/src/plugins/debugger/debuggeruiswitcher.cpp
+++ b/src/plugins/debugger/debuggeruiswitcher.cpp
@@ -229,13 +229,22 @@ void DebuggerUISwitcher::updateUiForTarget(ProjectExplorer::Target *target)
     }
 }
 
+static bool isQmlProjectType(ProjectExplorer::RunConfiguration *rc)
+{
+    if (rc && rc->target() && rc->target()->project()) {
+        return (rc->target()->project()->id() == QLatin1String("QmlProjectManager.QmlProject"));
+    }
+    return false;
+}
+
 // updates default debug language settings per run config.
 void DebuggerUISwitcher::updateUiForRunConfiguration(ProjectExplorer::RunConfiguration *rc)
 {
+    bool isDotQmlProjectType = isQmlProjectType(rc);
     if (rc) {
         d->m_languageActionGroup->setDisabled(false);
         if (DebuggerRunControl::isQmlProject(rc) && d->m_qmlEnabled) {
-            d->m_activateCppAction->setChecked(true);
+            d->m_activateCppAction->setChecked(!isDotQmlProjectType);
             d->m_activateQmlAction->setChecked(true);
         } else {
             if (d->m_activateQmlAction) {
-- 
GitLab