aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-02-11 15:18:18 -0600
committerTed Gould <ted@gould.cx>2014-02-11 15:18:18 -0600
commita38509fd4b0023456c48fcb014f6ba0063b16f23 (patch)
tree11bd8ffd341f5068477a96801ced044269776bcc /src
parent6e67bf9139adfbd9bfd8b7a32ec061d63514efe9 (diff)
downloadayatana-indicator-sound-a38509fd4b0023456c48fcb014f6ba0063b16f23.tar.gz
ayatana-indicator-sound-a38509fd4b0023456c48fcb014f6ba0063b16f23.tar.bz2
ayatana-indicator-sound-a38509fd4b0023456c48fcb014f6ba0063b16f23.zip
Building the service over in the new object
Diffstat (limited to 'src')
-rw-r--r--src/accounts-service-user.vala9
-rw-r--r--src/service.vala6
2 files changed, 13 insertions, 2 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala
index 56d981d..7639b2e 100644
--- a/src/accounts-service-user.vala
+++ b/src/accounts-service-user.vala
@@ -18,7 +18,14 @@
*/
-public class AccountServiceUser : Object {
+public class AccountsServiceUser : Object {
+ Act.UserManager accounts_manager = Act.UserManager.get_default();
+ Act.User? user = null;
+
+ public AccountsServiceUser () {
+ user = accounts_manager.get_user(GLib.Environment.get_user_name());
+
+ }
diff --git a/src/service.vala b/src/service.vala
index a246758..b6ed0a5 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -42,6 +42,10 @@ public class IndicatorSound.Service {
this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE);
});
+ if (GLib.Environment.get_user_name() != "lightdm") {
+ accounts_service = new AccountsServiceUser();
+ }
+
this.sync_preferred_players ();
this.settings.changed["interested-media-players"].connect ( () => {
this.sync_preferred_players ();
@@ -87,7 +91,7 @@ public class IndicatorSound.Service {
uint player_action_update_id;
Notify.Notification notification;
bool syncing_preferred_players = false;
- Act.UserManager account_manager = Act.UserManager.get_default();
+ AccountsServiceUser? accounts_service = null;
const double volume_step_percentage = 0.06;