aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-17 19:50:20 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-14 15:21:45 +0800
commita61311603e6670de140584ee8dd70aeea078cc38 (patch)
tree366edbd011701f0dbfc9e5bc95ca6bec4ba98c2e
parent1d5260ad9bd4a36c234878133b63d46fea173c45 (diff)
downloadgsoc2013-empathy-a61311603e6670de140584ee8dd70aeea078cc38.tar
gsoc2013-empathy-a61311603e6670de140584ee8dd70aeea078cc38.tar.gz
gsoc2013-empathy-a61311603e6670de140584ee8dd70aeea078cc38.tar.bz2
gsoc2013-empathy-a61311603e6670de140584ee8dd70aeea078cc38.tar.lz
gsoc2013-empathy-a61311603e6670de140584ee8dd70aeea078cc38.tar.xz
gsoc2013-empathy-a61311603e6670de140584ee8dd70aeea078cc38.tar.zst
gsoc2013-empathy-a61311603e6670de140584ee8dd70aeea078cc38.zip
roster-view: sort items
-rw-r--r--libempathy-gtk/empathy-roster-view.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 76e74b356..21fabd4f9 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -127,6 +127,23 @@ members_changed_cb (EmpathyIndividualManager *manager,
}
}
+static gint
+roster_view_sort (EmpathyRosterItem *a,
+ EmpathyRosterItem *b,
+ EmpathyRosterView *self)
+{
+ FolksIndividual *ind_a, *ind_b;
+ const gchar *alias_a, *alias_b;
+
+ ind_a = empathy_roster_item_get_individual (a);
+ ind_b = empathy_roster_item_get_individual (b);
+
+ alias_a = folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (ind_a));
+ alias_b = folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (ind_b));
+
+ return g_ascii_strcasecmp (alias_a, alias_b);
+}
+
static void
empathy_roster_view_constructed (GObject *object)
{
@@ -152,6 +169,9 @@ empathy_roster_view_constructed (GObject *object)
G_CALLBACK (members_changed_cb), self, 0);
g_list_free (individuals);
+
+ egg_list_box_set_sort_func (EGG_LIST_BOX (self),
+ (GCompareDataFunc) roster_view_sort, self, NULL);
}
static void