From 61d3328c1a41b3704db9e96c8f9a27b42e649aca Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 20 Mar 2014 15:48:03 -0500 Subject: If the user is already loaded don't wait on it. --- src/accounts-service-user.vala | 13 +++++++++---- 1 file 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 ( BusType.SYSTEM, "org.freedesktop.Accounts", @@ -105,7 +110,7 @@ public class AccountsServiceUser : Object { DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, new_proxy); - }); + } } ~AccountsServiceUser () { -- cgit v1.2.3