From e5e0797bd598537889825f47facff64d430d1fe3 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Sat, 24 Feb 2024 08:37:08 -0500 Subject: [PATCH] Qt: If no preferences have changed, don't signal Enforce the requirement, already mentioned in the headers, that preference and preference module effect flags must be nonzero so that the application knows that a preference has changed. (Lua, for example, needs this.) Use this and avoid sending the PreferencesChanged signal when preferences have not changed. --- epan/prefs.c | 6 ++++++ ui/qt/preferences_dialog.cpp | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/epan/prefs.c b/epan/prefs.c index a69e51d8fb..7515f30d47 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -6614,6 +6614,9 @@ void prefs_set_effect_flags(pref_t *pref, unsigned int flags) { if (pref != NULL) { + if (flags == 0) { + ws_error("Setting \"%s\" preference effect flags to 0", pref->name); + } pref->effect_flags = flags; } } @@ -6637,6 +6640,9 @@ void prefs_set_module_effect_flags(module_t * module, unsigned int flags) { if (module != NULL) { + if (flags == 0) { + ws_error("Setting module \"%s\" preference effect flags to 0", module->name); + } module->effect_flags = flags; } } diff --git a/ui/qt/preferences_dialog.cpp b/ui/qt/preferences_dialog.cpp index 7e41fc43ee..9f7cb6afa3 100644 --- a/ui/qt/preferences_dialog.cpp +++ b/ui/qt/preferences_dialog.cpp @@ -325,7 +325,10 @@ void PreferencesDialog::on_buttonBox_accepted() /* Redissect all the packets, and re-evaluate the display filter. */ mainApp->queueAppSignal(MainApplication::PacketDissectionChanged); } - mainApp->queueAppSignal(MainApplication::PreferencesChanged); + + if (redissect_flags) { + mainApp->queueAppSignal(MainApplication::PreferencesChanged); + } if (redissect_flags & PREF_EFFECT_GUI_LAYOUT) { mainApp->queueAppSignal(MainApplication::RecentPreferencesRead);