From 25f97f15ce5024b6225caa6710bcf6653e7c84ee Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 22 Feb 2017 13:03:49 +0100 Subject: [PATCH] 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 --- .../cc-online-accounts-panel.c | 57 ++++++++++--------- 1 file 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 f9759d07d..589139f78 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) {