aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-06 20:09:05 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-18 21:40:09 +0800
commit3cceb20e7ded94d9a797f53704b53afde9e5176f (patch)
treeef136e99ba7ce8254c22a4523e3702697eb5ab97 /libempathy-gtk
parent08ba02749235ae95a586fa930690f921e74bda35 (diff)
downloadgsoc2013-empathy-3cceb20e7ded94d9a797f53704b53afde9e5176f.tar
gsoc2013-empathy-3cceb20e7ded94d9a797f53704b53afde9e5176f.tar.gz
gsoc2013-empathy-3cceb20e7ded94d9a797f53704b53afde9e5176f.tar.bz2
gsoc2013-empathy-3cceb20e7ded94d9a797f53704b53afde9e5176f.tar.lz
gsoc2013-empathy-3cceb20e7ded94d9a797f53704b53afde9e5176f.tar.xz
gsoc2013-empathy-3cceb20e7ded94d9a797f53704b53afde9e5176f.tar.zst
gsoc2013-empathy-3cceb20e7ded94d9a797f53704b53afde9e5176f.zip
individual-view: add API to define our own filter function
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-individual-view.c17
-rw-r--r--libempathy-gtk/empathy-individual-view.h4
2 files changed, 21 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index fcbc93fa4..dbd8f336b 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -88,6 +88,9 @@ typedef struct
/* Distance between mouse pointer and the nearby border. Negative when
scrolling updards.*/
gint distance;
+
+ GtkTreeModelFilterVisibleFunc custom_filter;
+ gpointer custom_filter_data;
} EmpathyIndividualViewPriv;
typedef struct
@@ -1800,6 +1803,9 @@ individual_view_filter_visible_func (GtkTreeModel *model,
gboolean visible, is_online;
gboolean is_searching = TRUE;
+ if (priv->custom_filter != NULL)
+ return priv->custom_filter (model, iter, priv->custom_filter_data);
+
if (priv->search_widget == NULL ||
!gtk_widget_get_visible (priv->search_widget))
is_searching = FALSE;
@@ -2843,3 +2849,14 @@ empathy_individual_view_start_search (EmpathyIndividualView *self)
else
gtk_widget_show (GTK_WIDGET (priv->search_widget));
}
+
+void
+empathy_individual_view_set_custom_filter (EmpathyIndividualView *self,
+ GtkTreeModelFilterVisibleFunc filter,
+ gpointer data)
+{
+ EmpathyIndividualViewPriv *priv = GET_PRIV (self);
+
+ priv->custom_filter = filter;
+ priv->custom_filter_data = data;
+}
diff --git a/libempathy-gtk/empathy-individual-view.h b/libempathy-gtk/empathy-individual-view.h
index bae7fbcba..ae94ed3d6 100644
--- a/libempathy-gtk/empathy-individual-view.h
+++ b/libempathy-gtk/empathy-individual-view.h
@@ -129,5 +129,9 @@ void empathy_individual_view_set_store (EmpathyIndividualView *self,
void empathy_individual_view_start_search (EmpathyIndividualView *self);
+void empathy_individual_view_set_custom_filter (EmpathyIndividualView *self,
+ GtkTreeModelFilterVisibleFunc filter,
+ gpointer data);
+
G_END_DECLS
#endif /* __EMPATHY_INDIVIDUAL_VIEW_H__ */