From 86d0eb0830e2ec65dc103a793e442b0cfcf0ef2a Mon Sep 17 00:00:00 2001 From: Lasse Holmstedt <lasse.holmstedt@nokia.com> Date: Wed, 25 Aug 2010 11:25:30 +0200 Subject: [PATCH] Debugger UI: Don't write QML settings if QML debugging is disabled --- src/plugins/debugger/debuggeruiswitcher.cpp | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/plugins/debugger/debuggeruiswitcher.cpp b/src/plugins/debugger/debuggeruiswitcher.cpp index 43bd5e42274..d5843718db7 100644 --- a/src/plugins/debugger/debuggeruiswitcher.cpp +++ b/src/plugins/debugger/debuggeruiswitcher.cpp @@ -651,7 +651,7 @@ void DebuggerUISwitcher::writeSettings() const } settings->endGroup(); } - { + if (d->m_qmlEnabled) { settings->beginGroup(QLatin1String("DebugMode.CppQmlMode")); QHashIterator<QString, QVariant> it(d->m_dockWidgetActiveStateQmlCpp); while (it.hasNext()) { @@ -674,21 +674,25 @@ void DebuggerUISwitcher::readSettings() } settings->endGroup(); - settings->beginGroup(QLatin1String("DebugMode.CppQmlMode")); - foreach (const QString &key, settings->childKeys()) { - d->m_dockWidgetActiveStateQmlCpp.insert(key, settings->value(key)); + if (d->m_qmlEnabled) { + settings->beginGroup(QLatin1String("DebugMode.CppQmlMode")); + foreach (const QString &key, settings->childKeys()) { + d->m_dockWidgetActiveStateQmlCpp.insert(key, settings->value(key)); + } + settings->endGroup(); } - settings->endGroup(); // reset initial settings when there are none yet - if (d->m_dockWidgetActiveStateCpp.isEmpty() || d->m_dockWidgetActiveStateQmlCpp.isEmpty()) { - DebuggerLanguages langs = d->m_activeDebugLanguages; - d->m_activeDebugLanguages = QmlLanguage; - resetDebuggerLayout(); + DebuggerLanguages langs = d->m_activeDebugLanguages; + if (d->m_dockWidgetActiveStateCpp.isEmpty()) { d->m_activeDebugLanguages = CppLanguage; resetDebuggerLayout(); - d->m_activeDebugLanguages = langs; } + if (d->m_qmlEnabled && d->m_dockWidgetActiveStateQmlCpp.isEmpty()) { + d->m_activeDebugLanguages = QmlLanguage; + resetDebuggerLayout(); + } + d->m_activeDebugLanguages = langs; } void DebuggerUISwitcher::initialize() -- GitLab