aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-21 14:34:52 -0500
committerTed Gould <ted@gould.cx>2014-03-21 14:34:52 -0500
commitd114c16f06803c8619d652b3a9dda31da3f1699a (patch)
tree6b51a460d49a87ed1f57c1792a1f232547dce443
parent831571ad497d790701d82305c57d8e69188a62ee (diff)
parentaee881c058971adcbe676d0d24d4924a0f38ef67 (diff)
downloadayatana-indicator-sound-d114c16f06803c8619d652b3a9dda31da3f1699a.tar.gz
ayatana-indicator-sound-d114c16f06803c8619d652b3a9dda31da3f1699a.tar.bz2
ayatana-indicator-sound-d114c16f06803c8619d652b3a9dda31da3f1699a.zip
Updating to latest export
-rw-r--r--src/accounts-service-user.vala23
-rw-r--r--src/service.vala33
-rw-r--r--src/volume-control.vala1
3 files changed, 50 insertions, 7 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala
index 052c7a0..c29842a 100644
--- a/src/accounts-service-user.vala
+++ b/src/accounts-service-user.vala
@@ -42,9 +42,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;
@@ -84,11 +93,16 @@ 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;
+ 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",
@@ -96,10 +110,11 @@ public class AccountsServiceUser : Object {
DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
null,
new_proxy);
- });
+ }
}
~AccountsServiceUser () {
+ debug("Account Service Object Finalizing");
this.player = null;
if (this.timer != 0) {
diff --git a/src/service.vala b/src/service.vala
index 1617887..0e32bfe 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -67,20 +67,39 @@ public class IndicatorSound.Service: Object {
sharedsettings.bind ("allow-amplified-volume", this, "allow-amplified-volume", SettingsBindFlags.GET);
}
+ ~Service() {
+ if (this.sound_was_blocked_timeout_id > 0) {
+ Source.remove (this.sound_was_blocked_timeout_id);
+ this.sound_was_blocked_timeout_id = 0;
+ }
+ }
+
void build_accountsservice () {
+ clear_acts_player();
this.accounts_service = null;
/* If we're not exporting, don't build anything */
if (!this.settings.get_boolean("greeter-export")) {
+ debug("Accounts service export disabled due to user setting");
return;
}
/* If we're on the greeter, don't export */
if (GLib.Environment.get_user_name() == "lightdm") {
+ debug("Accounts service export disabled due to being used on the greeter");
return;
}
this.accounts_service = new AccountsServiceUser();
+
+ this.eventually_update_player_actions();
+ }
+
+ void clear_acts_player () {
+ /* NOTE: This is a bit of a hack to ensure that accounts service doesn't
+ continue to export the player by keeping a ref in the timer */
+ if (this.accounts_service != null)
+ this.accounts_service.player = null;
}
public int run () {
@@ -93,8 +112,17 @@ public class IndicatorSound.Service: Object {
this.bus_acquired, null, this.name_lost);
this.loop = new MainLoop (null, false);
+
+ GLib.Unix.signal_add(GLib.ProcessSignal.TERM, () => {
+ debug("SIGTERM recieved, stopping our mainloop");
+ this.loop.quit();
+ return false;
+ });
+
this.loop.run ();
+ clear_acts_player();
+
return 0;
}
@@ -381,9 +409,8 @@ public class IndicatorSound.Service: Object {
}
}
- if (clear_accounts_player && accounts_service != null) {
- accounts_service.player = null;
- }
+ if (clear_accounts_player)
+ clear_acts_player();
this.player_action_update_id = 0;
return false;
diff --git a/src/volume-control.vala b/src/volume-control.vala
index 8f21b60..03cac0b 100644
--- a/src/volume-control.vala
+++ b/src/volume-control.vala
@@ -56,6 +56,7 @@ public class VolumeControl : Object
{
if (_reconnect_timer != 0) {
Source.remove (_reconnect_timer);
+ _reconnect_timer = 0;
}
}