[empathy] factor out empathy_account_chooser_refilter()
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] factor out empathy_account_chooser_refilter()
- Date: Thu, 27 Oct 2011 11:45:46 +0000 (UTC)
commit 75e36b52f5dbe565aba6fcaf201a8ed1f2557b02
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Mon Oct 24 15:26:26 2011 +0200
factor out empathy_account_chooser_refilter()
https://bugzilla.gnome.org/show_bug.cgi?id=662609
libempathy-gtk/empathy-account-chooser.c | 16 +++++++++++-----
libempathy-gtk/empathy-account-chooser.h | 2 ++
2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c
index 289170d..5aa9854 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 ac67a28..d58fcf1 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]