diff options
author | Ted Gould <ted@gould.cx> | 2015-02-19 16:27:24 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-02-19 16:27:24 +0000 |
commit | 14be74296b0bd81a797373c4c972916277d0428e (patch) | |
tree | 6833db57605bf225620214218a427fe0f0a4444b /src/sound-menu.vala | |
parent | 403caf562ba967342b78d5491229fe40cc908361 (diff) | |
parent | 18891aa50808f29365f763cc503e5dfa2e17ab17 (diff) | |
download | ayatana-indicator-sound-14be74296b0bd81a797373c4c972916277d0428e.tar.gz ayatana-indicator-sound-14be74296b0bd81a797373c4c972916277d0428e.tar.bz2 ayatana-indicator-sound-14be74296b0bd81a797373c4c972916277d0428e.zip |
Add notifications mock and tests
Approved by: Jussi Pakkanen, PS Jenkins bot
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r-- | src/sound-menu.vala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala index 96dd143..8718162 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -73,9 +73,20 @@ public class SoundMenu: Object this.greeter_players = (flags & DisplayFlags.GREETER_PLAYERS) != 0; } + ~SoundMenu () { + if (export_id != 0) { + bus.unexport_menu_model(export_id); + export_id = 0; + } + } + + DBusConnection? bus = null; + uint export_id = 0; + public void export (DBusConnection connection, string object_path) { + bus = connection; try { - connection.export_menu_model (object_path, this.root); + export_id = bus.export_menu_model (object_path, this.root); } catch (Error e) { critical ("%s", e.message); } |