aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-17 19:37:06 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-18 16:46:20 +0800
commitf2c015b36e6676796cfd8b48f1022b1d94fa46bb (patch)
treea346895e579948feb107c645cbd6035e7819c7f3 /libempathy-gtk
parent3f68089b0c3a481fa56462efa86858a71d16c260 (diff)
downloadgsoc2013-empathy-f2c015b36e6676796cfd8b48f1022b1d94fa46bb.tar
gsoc2013-empathy-f2c015b36e6676796cfd8b48f1022b1d94fa46bb.tar.gz
gsoc2013-empathy-f2c015b36e6676796cfd8b48f1022b1d94fa46bb.tar.bz2
gsoc2013-empathy-f2c015b36e6676796cfd8b48f1022b1d94fa46bb.tar.lz
gsoc2013-empathy-f2c015b36e6676796cfd8b48f1022b1d94fa46bb.tar.xz
gsoc2013-empathy-f2c015b36e6676796cfd8b48f1022b1d94fa46bb.tar.zst
gsoc2013-empathy-f2c015b36e6676796cfd8b48f1022b1d94fa46bb.zip
add empathy_individual_view_select_first()
https://bugzilla.gnome.org/show_bug.cgi?id=661993
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-individual-view.c17
-rw-r--r--libempathy-gtk/empathy-individual-view.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 51c9dfc29..88397ae70 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);
+ }
+}
diff --git a/libempathy-gtk/empathy-individual-view.h b/libempathy-gtk/empathy-individual-view.h
index 5090bc7cc..4d52ef536 100644
--- a/libempathy-gtk/empathy-individual-view.h
+++ b/libempathy-gtk/empathy-individual-view.h
@@ -135,5 +135,7 @@ void empathy_individual_view_set_custom_filter (EmpathyIndividualView *self,
void empathy_individual_view_refilter (EmpathyIndividualView *self);
+void empathy_individual_view_select_first (EmpathyIndividualView *self);
+
G_END_DECLS
#endif /* __EMPATHY_INDIVIDUAL_VIEW_H__ */