aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-24 21:26:26 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-27 19:44:29 +0800
commit75e36b52f5dbe565aba6fcaf201a8ed1f2557b02 (patch)
treecaf7159d5822f57c7407ed5a00db7ef996d716c6 /libempathy-gtk
parente220eb6b5dceb755e7858e465e78a46d555555f2 (diff)
downloadgsoc2013-empathy-75e36b52f5dbe565aba6fcaf201a8ed1f2557b02.tar
gsoc2013-empathy-75e36b52f5dbe565aba6fcaf201a8ed1f2557b02.tar.gz
gsoc2013-empathy-75e36b52f5dbe565aba6fcaf201a8ed1f2557b02.tar.bz2
gsoc2013-empathy-75e36b52f5dbe565aba6fcaf201a8ed1f2557b02.tar.lz
gsoc2013-empathy-75e36b52f5dbe565aba6fcaf201a8ed1f2557b02.tar.xz
gsoc2013-empathy-75e36b52f5dbe565aba6fcaf201a8ed1f2557b02.tar.zst
gsoc2013-empathy-75e36b52f5dbe565aba6fcaf201a8ed1f2557b02.zip
factor out empathy_account_chooser_refilter()
https://bugzilla.gnome.org/show_bug.cgi?id=662609
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-chooser.c16
-rw-r--r--libempathy-gtk/empathy-account-chooser.h2
2 files changed, 13 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c
index 289170d15..5aa9854e5 100644
--- a/libempathy-gtk/empathy-account-chooser.c
+++ b/libempathy-gtk/empathy-account-chooser.c
@@ -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);
}
/**
diff --git a/libempathy-gtk/empathy-account-chooser.h b/libempathy-gtk/empathy-account-chooser.h
index ac67a28e4..d58fcf12f 100644
--- a/libempathy-gtk/empathy-account-chooser.h
+++ b/libempathy-gtk/empathy-account-chooser.h
@@ -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,