aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-20 15:48:03 -0500
committerTed Gould <ted@gould.cx>2014-03-20 15:48:03 -0500
commit61d3328c1a41b3704db9e96c8f9a27b42e649aca (patch)
tree416e9fe78b1d09febf053f6a78ae55484bca6c63 /src
parentcdfa2afeb95b1067bde7412b6cee744a1ab0e0b9 (diff)
downloadayatana-indicator-sound-61d3328c1a41b3704db9e96c8f9a27b42e649aca.tar.gz
ayatana-indicator-sound-61d3328c1a41b3704db9e96c8f9a27b42e649aca.tar.bz2
ayatana-indicator-sound-61d3328c1a41b3704db9e96c8f9a27b42e649aca.zip
If the user is already loaded don't wait on it.
Diffstat (limited to 'src')
-rw-r--r--src/accounts-service-user.vala13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala
index 77dc9d4..e18e20f 100644
--- a/src/accounts-service-user.vala
+++ b/src/accounts-service-user.vala
@@ -93,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",
@@ -105,7 +110,7 @@ public class AccountsServiceUser : Object {
DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
null,
new_proxy);
- });
+ }
}
~AccountsServiceUser () {