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.
This commit is contained in:
John Thacker 2024-02-24 08:37:08 -05:00
parent 63d6edbd3e
commit e5e0797bd5
2 changed files with 10 additions and 1 deletions

View File

@ -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;
}
}

View File

@ -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);