[gdm/gnome-2-30] Add API to queue loading of users



commit 9ab0c955326c9be530757dde8f31594b88593c69
Author: William Jon McCann <jmccann redhat com>
Date:   Wed Jun 9 11:22:26 2010 -0400

    Add API to queue loading of users
    
    Don't queue a load on construction in case it isn't needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=621131

 gui/simple-greeter/gdm-user-chooser-widget.c |    1 +
 gui/simple-greeter/gdm-user-manager.c        |   10 ++++++++++
 gui/simple-greeter/gdm-user-manager.h        |    1 +
 gui/user-switch-applet/applet.c              |    1 +
 4 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-user-chooser-widget.c b/gui/simple-greeter/gdm-user-chooser-widget.c
index f7fc47e..0fdd950 100644
--- a/gui/simple-greeter/gdm-user-chooser-widget.c
+++ b/gui/simple-greeter/gdm-user-chooser-widget.c
@@ -599,6 +599,7 @@ load_users (GdmUserChooserWidget *widget)
                                   "user-changed",
                                   G_CALLBACK (on_user_changed),
                                   widget);
+                gdm_user_manager_queue_load (widget->priv->manager);
         } else {
                 gdm_chooser_widget_loaded (GDM_CHOOSER_WIDGET (widget));
         }
diff --git a/gui/simple-greeter/gdm-user-manager.c b/gui/simple-greeter/gdm-user-manager.c
index bd6e717..30343ea 100644
--- a/gui/simple-greeter/gdm-user-manager.c
+++ b/gui/simple-greeter/gdm-user-manager.c
@@ -1672,6 +1672,16 @@ gdm_set_string_list (char *value, GSList **retval)
         g_strfreev (temp_array);
 }
 
+void
+gdm_user_manager_queue_load (GdmUserManager *manager)
+{
+        g_return_if_fail (GDM_IS_USER_MANAGER (manager));
+
+        if (! manager->priv->is_loaded) {
+                queue_load_users (manager);
+        }
+}
+
 static void
 gdm_user_manager_init (GdmUserManager *manager)
 {
diff --git a/gui/simple-greeter/gdm-user-manager.h b/gui/simple-greeter/gdm-user-manager.h
index 3e976ff..35d7423 100644
--- a/gui/simple-greeter/gdm-user-manager.h
+++ b/gui/simple-greeter/gdm-user-manager.h
@@ -69,6 +69,7 @@ GType               gdm_user_manager_get_type              (void);
 
 GdmUserManager *    gdm_user_manager_ref_default           (void);
 
+void                gdm_user_manager_queue_load            (GdmUserManager *manager);
 GSList *            gdm_user_manager_list_users            (GdmUserManager *manager);
 GdmUser *           gdm_user_manager_get_user              (GdmUserManager *manager,
                                                             const char     *user_name);
diff --git a/gui/user-switch-applet/applet.c b/gui/user-switch-applet/applet.c
index cbeb869..744dda6 100644
--- a/gui/user-switch-applet/applet.c
+++ b/gui/user-switch-applet/applet.c
@@ -1503,6 +1503,7 @@ fill_applet (PanelApplet *applet)
         gtk_widget_show (adata->menubar);
 
         adata->manager = gdm_user_manager_ref_default ();
+        gdm_user_manager_queue_load (adata->manager);
         setup_current_user (adata);
 
         gconf_client_add_dir (adata->client,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]