diff options
author | charles kerr <charlesk@canonical.com> | 2015-12-30 16:03:02 -0600 |
---|---|---|
committer | charles kerr <charlesk@canonical.com> | 2015-12-30 16:03:02 -0600 |
commit | 521915475eb73ae22e2c270c687f1f4d5c7c0465 (patch) | |
tree | 7cdb4c2a75f06ef6b1558c12557800684b55d0fe /src/options-gsettings.vala | |
parent | 812e71f004272f635ba9217ef2f16aa9567196b3 (diff) | |
download | ayatana-indicator-sound-521915475eb73ae22e2c270c687f1f4d5c7c0465.tar.gz ayatana-indicator-sound-521915475eb73ae22e2c270c687f1f4d5c7c0465.tar.bz2 ayatana-indicator-sound-521915475eb73ae22e2c270c687f1f4d5c7c0465.zip |
simplify the Options class' properties
Diffstat (limited to 'src/options-gsettings.vala')
-rw-r--r-- | src/options-gsettings.vala | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/src/options-gsettings.vala b/src/options-gsettings.vala index a524390..e3bba91 100644 --- a/src/options-gsettings.vala +++ b/src/options-gsettings.vala @@ -62,18 +62,6 @@ public class IndicatorSound.OptionsGSettings : Options /** LOUD VOLUME **/ - private PulseAudio.Volume _loud_volume; - - public override PulseAudio.Volume loud_volume() { - return _loud_volume; - } - - private bool _loud_volume_warning_enabled; - - public override bool loud_volume_warning_enabled() { - return _loud_volume_warning_enabled; - } - private string loud_enabled_key = "warning-volume-enabled"; private string loud_decibel_key = "warning-volume-decibels"; @@ -83,22 +71,13 @@ public class IndicatorSound.OptionsGSettings : Options update_loud_volume(); } private void update_loud_volume() { - var changed = false; - var vol = PulseAudio.Volume.sw_from_dB (_settings.get_double (loud_decibel_key)); - var enabled = _settings.get_boolean(loud_enabled_key); - if (_loud_volume != vol) { - debug("updating loud_volume_sw to %d", (int)vol); - _loud_volume = vol; - changed = true; - } - if (_loud_volume_warning_enabled != enabled) { - debug("updating loud_volume_warning_enabled to %d", (int)enabled); - _loud_volume_warning_enabled = enabled; - changed = true; - } + var vol = PulseAudio.Volume.sw_from_dB (_settings.get_double (loud_decibel_key)); + if (loud_volume != vol) + loud_volume = vol; - if (changed) - loud_changed(); + var enabled = _settings.get_boolean(loud_enabled_key); + if (loud_warning_enabled != enabled) + loud_warning_enabled = enabled; } } |