From: Guillaume Desmottes Date: Mon, 24 Oct 2011 13:51:23 +0000 (+0200) Subject: factor out update_account() X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=a6d4518c76cf1c78bd954bb2488d6f01868dd337 factor out update_account() https://bugzilla.gnome.org/show_bug.cgi?id=662609 --- diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c index e7f2bd5b..c0df6a6a 100644 --- a/libempathy-gtk/empathy-account-chooser.c +++ b/libempathy-gtk/empathy-account-chooser.c @@ -152,6 +152,8 @@ static gboolean account_chooser_set_account_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, SetAccountData *data); +static void update_account (EmpathyAccountChooser *self, + TpAccount *account); enum { PROP_0, @@ -851,6 +853,16 @@ account_chooser_update_iter (EmpathyAccountChooser *self, g_object_unref (account); } +static void +update_account (EmpathyAccountChooser *self, + TpAccount *account) +{ + GtkTreeIter iter; + + if (account_chooser_find_account (self, account, &iter)) + account_chooser_update_iter (self, &iter); +} + static void account_chooser_status_changed_cb (TpAccount *account, guint old_status, @@ -861,10 +873,8 @@ account_chooser_status_changed_cb (TpAccount *account, gpointer user_data) { EmpathyAccountChooser *self = user_data; - GtkTreeIter iter; - if (account_chooser_find_account (self, account, &iter)) - account_chooser_update_iter (self, &iter); + update_account (self, account); } static gboolean