summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/debuggermainwindow.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2011-10-12 16:30:14 +0200
committerhjk <qthjk@ovi.com>2011-10-13 17:43:57 +0200
commitf5ec093e3bd38910a603d7faa233d1b0e7348cbe (patch)
treeeb19b28e54e78af4fe4bc802b6f81dc81a8dd483 /src/plugins/debugger/debuggermainwindow.cpp
parentb0a20e122036e799654f703fd1f1df3fc05370d8 (diff)
downloadqt-creator-f5ec093e3bd38910a603d7faa233d1b0e7348cbe.tar.gz
Debugger: Automatically adapt to the languages the running engine supports
We used to get the layout only from the current/last run configuration. However, this fails for engines started by other means (Debug->Start Debugging submenu). Change-Id: I87e12457c7cd68a326ac1827298a3542e149199b Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/debugger/debuggermainwindow.cpp')
-rw-r--r--src/plugins/debugger/debuggermainwindow.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp
index 94718c19f1..92a318fb49 100644
--- a/src/plugins/debugger/debuggermainwindow.cpp
+++ b/src/plugins/debugger/debuggermainwindow.cpp
@@ -134,6 +134,7 @@ public:
DebuggerLanguages m_previousDebugLanguages;
DebuggerLanguages m_activeDebugLanguages;
+ DebuggerLanguages m_engineDebugLanguages;
ActionContainer *m_viewsMenu;
@@ -151,6 +152,7 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *mw)
, m_changingUI(false)
, m_previousDebugLanguages(AnyLanguage)
, m_activeDebugLanguages(AnyLanguage)
+ , m_engineDebugLanguages(AnyLanguage)
, m_viewsMenu(0)
{
createViewsMenuItems();
@@ -222,11 +224,15 @@ void DebuggerMainWindowPrivate::updateActiveLanguages()
{
DebuggerLanguages newLanguages = AnyLanguage;
- if (m_previousRunConfiguration) {
- if (m_previousRunConfiguration.data()->useCppDebugger())
- newLanguages = CppLanguage;
- if (m_previousRunConfiguration.data()->useQmlDebugger())
- newLanguages |= QmlLanguage;
+ if (m_engineDebugLanguages != AnyLanguage)
+ newLanguages = m_engineDebugLanguages;
+ else {
+ if (m_previousRunConfiguration) {
+ if (m_previousRunConfiguration.data()->useCppDebugger())
+ newLanguages |= CppLanguage;
+ if (m_previousRunConfiguration.data()->useQmlDebugger())
+ newLanguages |= QmlLanguage;
+ }
}
if (newLanguages != m_activeDebugLanguages) {
@@ -269,6 +275,15 @@ DebuggerLanguages DebuggerMainWindow::activeDebugLanguages() const
return d->m_activeDebugLanguages;
}
+void DebuggerMainWindow::setEngineDebugLanguages(DebuggerLanguages languages)
+{
+ if (d->m_engineDebugLanguages == languages)
+ return;
+
+ d->m_engineDebugLanguages = languages;
+ d->updateActiveLanguages();
+}
+
void DebuggerMainWindow::onModeChanged(IMode *mode)
{
d->m_inDebugMode = (mode && mode->id() == Constants::MODE_DEBUG);