diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-08-12 13:16:40 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2015-08-12 13:16:40 -0500 |
commit | 480d998efb8bcd94401ff2d7c40a1fb9b81d8db1 (patch) | |
tree | 677c774c380914e03c76646d22cf40200fe4803c /src/volume-control-pulse.vala | |
parent | 361bd251b15581e5e53f89e2fc6948555f1d73e1 (diff) | |
download | ayatana-indicator-sound-480d998efb8bcd94401ff2d7c40a1fb9b81d8db1.tar.gz ayatana-indicator-sound-480d998efb8bcd94401ff2d7c40a1fb9b81d8db1.tar.bz2 ayatana-indicator-sound-480d998efb8bcd94401ff2d7c40a1fb9b81d8db1.zip |
in volume-control-pulse, extract methods from ctor and dtor for readability
Diffstat (limited to 'src/volume-control-pulse.vala')
-rw-r--r-- | src/volume-control-pulse.vala | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index 81938fe..87af258 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -105,17 +105,27 @@ public class VolumeControlPulse : VolumeControl _mute_cancellable = new Cancellable (); _volume_cancellable = new Cancellable (); - init_max_volume(); - init_high_volume(); - init_high_volume_approved(); + init_all_properties(); setup_accountsservice.begin (); this.reconnect_to_pulse (); } + private void init_all_properties() + { + init_max_volume(); + init_high_volume(); + init_high_volume_approved(); + } + ~VolumeControlPulse () { + stop_all_timers(); + } + + private void stop_all_timers() + { if (_reconnect_timer != 0) { Source.remove (_reconnect_timer); _reconnect_timer = 0; |