From f2c015b36e6676796cfd8b48f1022b1d94fa46bb Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 17 Oct 2011 13:37:06 +0200 Subject: add empathy_individual_view_select_first() https://bugzilla.gnome.org/show_bug.cgi?id=661993 --- libempathy-gtk/empathy-individual-view.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libempathy-gtk/empathy-individual-view.c') diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 51c9dfc2..88397ae7 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -2861,3 +2861,20 @@ empathy_individual_view_refilter (EmpathyIndividualView *self) gtk_tree_model_filter_refilter (priv->filter); } + +void +empathy_individual_view_select_first (EmpathyIndividualView *self) +{ + EmpathyIndividualViewPriv *priv = GET_PRIV (self); + GtkTreeIter iter; + + gtk_tree_model_filter_refilter (priv->filter); + + if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->filter), &iter)) + { + GtkTreeSelection *selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (self)); + + gtk_tree_selection_select_iter (selection, &iter); + } +} -- cgit v1.2.3