aboutsummaryrefslogtreecommitdiff
path: root/src/accounts-service-user.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/accounts-service-user.vala')
-rw-r--r--src/accounts-service-user.vala39
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) {