factor out empathy_account_chooser_refilter()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 24 Oct 2011 13:26:26 +0000 (15:26 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 27 Oct 2011 11:44:29 +0000 (13:44 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=662609

libempathy-gtk/empathy-account-chooser.c
libempathy-gtk/empathy-account-chooser.h

index 289170d15f97c0631cb353d87117711aa975de89..5aa9854e5a393652de2664db23934b2803270fd8 100644 (file)
@@ -907,6 +907,16 @@ account_chooser_filter_foreach (GtkTreeModel *model,
   return FALSE;
 }
 
+void
+empathy_account_chooser_refilter (EmpathyAccountChooser *self)
+{
+  GtkTreeModel *model;
+
+  self->priv->set_active_item = FALSE;
+  model = gtk_combo_box_get_model (GTK_COMBO_BOX (self));
+  gtk_tree_model_foreach (model, account_chooser_filter_foreach, self);
+}
+
 /**
  * empathy_account_chooser_set_filter:
  * @self: an #EmpathyAccountChooser
@@ -921,17 +931,13 @@ empathy_account_chooser_set_filter (EmpathyAccountChooser *self,
     EmpathyAccountChooserFilterFunc filter,
     gpointer user_data)
 {
-  GtkTreeModel *model;
-
   g_return_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (self));
 
   self->priv->filter = filter;
   self->priv->filter_data = user_data;
 
   /* Refilter existing data */
-  self->priv->set_active_item = FALSE;
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX (self));
-  gtk_tree_model_foreach (model, account_chooser_filter_foreach, self);
+  empathy_account_chooser_refilter (self);
 }
 
 /**
index ac67a28e4050f182097462298a6ff80d7624c43f..d58fcf12fbfa0743ee983ba1a63b31ae49a4a3ea 100644 (file)
@@ -108,6 +108,8 @@ void empathy_account_chooser_set_filter (EmpathyAccountChooser *self,
 
 gboolean empathy_account_chooser_is_ready (EmpathyAccountChooser *self);
 
+void empathy_account_chooser_refilter (EmpathyAccountChooser *self);
+
 /* Pre-defined filters */
 
 void empathy_account_chooser_filter_is_connected (TpAccount *account,