aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggerplugin.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2023-07-13 15:23:29 +0200
committerhjk <[email protected]>2023-07-14 08:39:08 +0000
commita5e773aeee40812cd4e8db88eda2521806ba40a4 (patch)
treec697f948c7c24c1333f29acccf4f8d1fdcdfb879 /src/plugins/debugger/debuggerplugin.cpp
parent9b2075e7eaa2d2c7c2f1742df62078745995e641 (diff)
Debugger: Adapt to latest settings access style
Change-Id: I14f737612b4fe6a37e650190b587ef0b04e559ea Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 9e1217307f9..152f928fb1e 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -585,7 +585,7 @@ public:
void writeSettings()
{
- m_debuggerSettings.writeSettings();
+ settings().writeSettings();
// writeWindowSettings();
}
@@ -684,7 +684,6 @@ public:
QTimer m_shutdownTimer;
Console m_console; // ensure Debugger Console is created before settings are taken into account
- DebuggerSettings m_debuggerSettings;
QStringList m_arguments;
DebuggerItemManager m_debuggerItemManager;
@@ -771,7 +770,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
Tr::tr("Debugger Runtime"),
Tr::tr("Issues with starting the debugger.")});
- m_debuggerSettings.readSettings();
+ settings().readSettings();
const auto addLabel = [](QWidget *widget, const QString &text) {
auto vbox = qobject_cast<QVBoxLayout *>(widget->layout());
@@ -784,10 +783,10 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
const auto addFontSizeAdaptation = [this](QWidget *widget) {
QObject::connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged,
- this, [widget](const FontSettings &settings) {
- if (!debuggerSettings()->fontSizeFollowsEditor.value())
+ this, [widget](const FontSettings &fs) {
+ if (!settings().fontSizeFollowsEditor())
return;
- qreal size = settings.fontZoom() * settings.fontSize() / 100.;
+ qreal size = fs.fontZoom() * fs.fontSize() / 100.;
QFont font = widget->font();
font.setPointSizeF(size);
widget->setFont(font);
@@ -1173,7 +1172,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
// Application interaction
// Use a queued connection so the dialog isn't triggered in the same event.
- connect(debuggerSettings()->settingsDialog.action(), &QAction::triggered, this,
+ connect(settings().settingsDialog.action(), &QAction::triggered, this,
[] { ICore::showOptionsDialog(DEBUGGER_COMMON_SETTINGS_ID); }, Qt::QueuedConnection);
m_perspective.useSubPerspectiveSwitcher(EngineManager::engineChooser());
@@ -1475,10 +1474,10 @@ void DebuggerPluginPrivate::updatePresetState()
// FIXME: Decentralize the actions below
const bool actionsEnabled = currentEngine->debuggerActionsEnabled();
const bool canDeref = actionsEnabled && currentEngine->hasCapability(AutoDerefPointersCapability);
- DebuggerSettings *s = debuggerSettings();
- s->autoDerefPointers.setEnabled(canDeref);
- s->autoDerefPointers.setEnabled(true);
- s->expandStack.setEnabled(actionsEnabled);
+ DebuggerSettings &s = settings();
+ s.autoDerefPointers.setEnabled(canDeref);
+ s.autoDerefPointers.setEnabled(true);
+ s.expandStack.setEnabled(actionsEnabled);
m_startAndDebugApplicationAction.setEnabled(true);
m_attachToQmlPortAction.setEnabled(true);
@@ -1973,8 +1972,8 @@ void DebuggerPluginPrivate::setInitialState()
m_enableOrDisableBreakpointAction.setEnabled(false);
//m_snapshotAction.setEnabled(false);
- debuggerSettings()->autoDerefPointers.setEnabled(true);
- debuggerSettings()->expandStack.setEnabled(false);
+ settings().autoDerefPointers.setEnabled(true);
+ settings().expandStack.setEnabled(false);
}
void DebuggerPluginPrivate::updateDebugWithoutDeployMenu()
@@ -2069,11 +2068,11 @@ void DebuggerPluginPrivate::extensionsInitialized()
QWidget *DebuggerPluginPrivate::addSearch(BaseTreeView *treeView)
{
- BoolAspect &act = debuggerSettings()->useAlternatingRowColors;
- treeView->setAlternatingRowColors(act.value());
+ BoolAspect &act = settings().useAlternatingRowColors;
+ treeView->setAlternatingRowColors(act());
treeView->setProperty(PerspectiveState::savesHeaderKey(), true);
connect(&act, &BaseAspect::changed, treeView, [treeView] {
- treeView->setAlternatingRowColors(debuggerSettings()->useAlternatingRowColors.value());
+ treeView->setAlternatingRowColors(settings().useAlternatingRowColors());
});
return ItemViewFind::createSearchableWrapper(treeView);