aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/texteditorsettings.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2024-02-15 08:34:54 +0200
committerOrgad Shaneh <orgads@gmail.com>2024-02-15 10:01:54 +0000
commit029ac3c4a1f6de15110ed182dcff6bc0f49afa19 (patch)
treeba54a1ccb142f383585a0468cc147705fb163c5d /src/plugins/texteditor/texteditorsettings.cpp
parent41131eadaa73d5a70620d0056e14d26005291b55 (diff)
TextEditor: Simplify settings initialization
* Consolidate and simplify behaviorSettingsChanged callbacks. * Do not call the callbacks during initialization, they are called later. Change-Id: Ica4b601e091de2112c7737047cbffa8a98fc9f70 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditorsettings.cpp')
-rw-r--r--src/plugins/texteditor/texteditorsettings.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp
index e3f96fa167..1d7dd89386 100644
--- a/src/plugins/texteditor/texteditorsettings.cpp
+++ b/src/plugins/texteditor/texteditorsettings.cpp
@@ -431,20 +431,11 @@ TextEditorSettings::TextEditorSettings()
connect(this, &TextEditorSettings::fontSettingsChanged,
this, updateGeneralMessagesFontSettings);
updateGeneralMessagesFontSettings();
- auto updateGeneralMessagesBehaviorSettings = []() {
- bool wheelZoom = d->m_behaviorSettingsPage.behaviorSettings().m_scrollWheelZooming;
- Core::MessageManager::setWheelZoomEnabled(wheelZoom);
- };
- connect(this, &TextEditorSettings::behaviorSettingsChanged,
- this, updateGeneralMessagesBehaviorSettings);
- updateGeneralMessagesBehaviorSettings();
-
- auto updateCamelCaseNavigation = [] {
- FancyLineEdit::setCamelCaseNavigationEnabled(globalBehaviorSettings().m_camelCaseNavigation);
- };
connect(this, &TextEditorSettings::behaviorSettingsChanged,
- this, updateCamelCaseNavigation);
- updateCamelCaseNavigation();
+ this, [](const BehaviorSettings &bs) {
+ Core::MessageManager::setWheelZoomEnabled(bs.m_scrollWheelZooming);
+ FancyLineEdit::setCamelCaseNavigationEnabled(bs.m_camelCaseNavigation);
+ });
}
TextEditorSettings::~TextEditorSettings()