[gnome-control-center] online-accounts: Shuffle some code around



commit 25f97f15ce5024b6225caa6710bcf6653e7c84ee
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Feb 22 13:03:49 2017 +0100

    online-accounts: Shuffle some code around
    
    This will make the subsequent commits easier to read.
    
    We are going to change get_row_for_account to be more generic. Moving
    this code higher up will let us use it from a few more call sites.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774222

 panels/online-accounts/cc-online-accounts-panel.c |   57 +++++++++++----------
 1 files changed, 30 insertions(+), 27 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c 
b/panels/online-accounts/cc-online-accounts-panel.c
index f9759d0..589139f 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -654,6 +654,36 @@ fill_accounts_listbox (CcGoaPanel *self)
   g_list_free_full (accounts, g_object_unref);
 }
 
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GtkWidget *
+get_row_for_account (CcGoaPanel *self,
+                     GoaObject *object)
+{
+  GtkWidget *row;
+  GList *children, *l;
+
+  row = NULL;
+  children = gtk_container_get_children (GTK_CONTAINER (self->accounts_listbox));
+
+  for (l = children; l != NULL; l = l->next)
+    {
+      GoaObject *row_object;
+
+      row_object = g_object_get_data (G_OBJECT (l->data), "goa-object");
+      if (row_object == object)
+        {
+          row = l->data;
+          break;
+        }
+    }
+
+  g_list_free (children);
+  return row;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
 static void
 on_account_added (GoaClient *client,
                   GoaObject *object,
@@ -801,33 +831,6 @@ get_all_providers_cb (GObject      *source,
 
 /* ---------------------------------------------------------------------------------------------------- */
 
-
-static GtkWidget *
-get_row_for_account (CcGoaPanel *self,
-                     GoaObject *object)
-{
-  GtkWidget *row;
-  GList *children, *l;
-
-  row = NULL;
-  children = gtk_container_get_children (GTK_CONTAINER (self->accounts_listbox));
-
-  for (l = children; l != NULL; l = l->next)
-    {
-      GoaObject *row_object;
-
-      row_object = g_object_get_data (G_OBJECT (l->data), "goa-object");
-      if (row_object == object)
-        {
-          row = l->data;
-          break;
-        }
-    }
-
-  g_list_free (children);
-  return row;
-}
-
 static void
 cancel_notification_timeout (CcGoaPanel *self)
 {


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