core/settings: force sending of signal when unit type changes

When changing between METRICS <-> IMPERIAL, all type signals are emitted.

This may cause double sending of some signals, but all signals will be emitted
at least once.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
jan Iversen 2020-01-03 17:47:58 +01:00 committed by Dirk Hohndel
parent fdff61f6af
commit 1d58d11676

View file

@ -124,6 +124,15 @@ void qPrefUnits::set_unit_system(unit_system_values value)
} }
disk_unit_system(true); disk_unit_system(true);
emit instance()->unit_systemChanged(value); emit instance()->unit_systemChanged(value);
emit instance()->unit_systemStringChanged(unit_system());
emit instance()->volumeChanged(prefs.units.volume);
emit instance()->volumeStringChanged(volume());
emit instance()->weightChanged(prefs.units.weight);
emit instance()->weightStringChanged(weight());
emit instance()->lengthChanged(prefs.units.length);
emit instance()->lengthStringChanged(length());
emit instance()->temperatureChanged(prefs.units.temperature);
emit instance()->temperatureStringChanged(temperature());
} }
DISK_LOADSYNC_ENUM(Units, "unit_system", unit_system_values, unit_system); DISK_LOADSYNC_ENUM(Units, "unit_system", unit_system_values, unit_system);