diff options
author | Ted Gould <ted@gould.cx> | 2014-03-21 16:35:59 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-03-21 16:35:59 -0500 |
commit | 2cce3ce2625f4c75375b5bbb155cc2afea5a8c1c (patch) | |
tree | 0c592ebeab5fb6acf6d0e69de56c400c33f900f0 /src/accounts-service-user.vala | |
parent | 1680e2e1552575d66898de0e3d90be0bfa354b7a (diff) | |
parent | d114c16f06803c8619d652b3a9dda31da3f1699a (diff) | |
download | ayatana-indicator-sound-2cce3ce2625f4c75375b5bbb155cc2afea5a8c1c.tar.gz ayatana-indicator-sound-2cce3ce2625f4c75375b5bbb155cc2afea5a8c1c.tar.bz2 ayatana-indicator-sound-2cce3ce2625f4c75375b5bbb155cc2afea5a8c1c.zip |
Updating to latest export
Diffstat (limited to 'src/accounts-service-user.vala')
-rw-r--r-- | src/accounts-service-user.vala | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala index ad2cef3..4dd7e6f 100644 --- a/src/accounts-service-user.vala +++ b/src/accounts-service-user.vala @@ -43,9 +43,18 @@ public class AccountsServiceUser : Object { } if (this._player == null) { + debug("Clearing player data in accounts service"); + /* Clear it */ this.proxy.player_name = ""; this.proxy.timestamp = 0; + this.proxy.title = ""; + this.proxy.artist = ""; + this.proxy.album = ""; + this.proxy.art_url = ""; + + var icon = new ThemedIcon.with_default_fallbacks ("application-default-icon"); + this.proxy.player_icon = icon.serialize(); } else { this.proxy.timestamp = GLib.get_monotonic_time(); this.proxy.player_name = this._player.name; @@ -85,11 +94,24 @@ public class AccountsServiceUser : Object { public AccountsServiceUser () { user = accounts_manager.get_user(GLib.Environment.get_user_name()); - user.notify["is-loaded"].connect(() => { - debug("User loaded"); + user.notify["is-loaded"].connect(() => user_loaded_changed()); + user_loaded_changed(); - this.proxy = null; + Bus.get_proxy.begin<GreeterBroadcast> ( + BusType.SYSTEM, + "com.canonical.Unity.Greeter.Broadcast", + "/com/canonical/Unity/Greeter/Broadcast", + DBusProxyFlags.NONE, + null, + greeter_proxy_new); + } + void user_loaded_changed () { + debug("User loaded changed"); + + this.proxy = null; + + if (this.user.is_loaded) { Bus.get_proxy.begin<AccountsServiceSoundSettings> ( BusType.SYSTEM, "org.freedesktop.Accounts", @@ -97,18 +119,11 @@ public class AccountsServiceUser : Object { DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, new_proxy); - }); - - Bus.get_proxy.begin<GreeterBroadcast> ( - BusType.SYSTEM, - "com.canonical.Unity.Greeter.Broadcast", - "/com/canonical/Unity/Greeter/Broadcast", - DBusProxyFlags.NONE, - null, - greeter_proxy_new); + } } ~AccountsServiceUser () { + debug("Account Service Object Finalizing"); this.player = null; if (this.timer != 0) { |