aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggeractions.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2021-03-05 12:48:26 +0100
committerhjk <[email protected]>2021-03-09 12:40:12 +0000
commit641604429a6e400324e60294f338e4eee5cb4631 (patch)
treea4c1706608d86a9f6372b18f2b2963539dafcac8 /src/plugins/debugger/debuggeractions.cpp
parentcb55af8e55b47fd5fae1a3bc9fe3ed9a1d2686ba (diff)
Debugger: Use an aspect for the source path mapping
More in line with the other settings. Change-Id: I86494f1955120cddda7d2f2eec8ba0fdbfd99585 Reviewed-by: David Schulz <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggeractions.cpp')
-rw-r--r--src/plugins/debugger/debuggeractions.cpp46
1 files changed, 4 insertions, 42 deletions
diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp
index 326ee706145..00374f27f46 100644
--- a/src/plugins/debugger/debuggeractions.cpp
+++ b/src/plugins/debugger/debuggeractions.cpp
@@ -41,55 +41,15 @@
#include <utils/qtcassert.h>
#include <QDebug>
-#include <QSettings>
using namespace Utils;
-static const char debugModeSettingsGroupC[] = "DebugMode";
-static const char cdbSettingsGroupC[] = "CDB2";
-static const char sourcePathMappingArrayNameC[] = "SourcePathMappings";
-static const char sourcePathMappingSourceKeyC[] = "Source";
-static const char sourcePathMappingTargetKeyC[] = "Target";
+const char debugModeSettingsGroupC[] = "DebugMode";
+const char cdbSettingsGroupC[] = "CDB2";
namespace Debugger {
namespace Internal {
-void GlobalDebuggerOptions::toSettings() const
-{
- QSettings *s = Core::ICore::settings();
- s->beginWriteArray(sourcePathMappingArrayNameC);
- if (!sourcePathMap.isEmpty()) {
- const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC);
- const QString sourcePathMappingTargetKey(sourcePathMappingTargetKeyC);
- int i = 0;
- for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd();
- it != cend;
- ++it, ++i) {
- s->setArrayIndex(i);
- s->setValue(sourcePathMappingSourceKey, it.key());
- s->setValue(sourcePathMappingTargetKey, it.value());
- }
- }
- s->endArray();
-}
-
-void GlobalDebuggerOptions::fromSettings()
-{
- QSettings *s = Core::ICore::settings();
- sourcePathMap.clear();
- if (const int count = s->beginReadArray(sourcePathMappingArrayNameC)) {
- const QString sourcePathMappingSourceKey(sourcePathMappingSourceKeyC);
- const QString sourcePathMappingTargetKey(sourcePathMappingTargetKeyC);
- for (int i = 0; i < count; ++i) {
- s->setArrayIndex(i);
- const QString key = s->value(sourcePathMappingSourceKey).toString();
- const QString value = s->value(sourcePathMappingTargetKey).toString();
- sourcePathMap.insert(key, value);
- }
- }
- s->endArray();
-}
-
//////////////////////////////////////////////////////////////////////////
//
// DebuggerSettings
@@ -604,6 +564,8 @@ DebuggerSettings::DebuggerSettings()
page1.registerAspect(&showQmlObjectTree);
page1.registerAspect(&stationaryEditorWhileStepping);
+ page1.registerAspect(&sourcePathMap);
+
// Page 2
page2.registerAspect(&gdbWatchdogTimeout);
page2.registerAspect(&skipKnownFrames);