[empathy] roster-view: sort items
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] roster-view: sort items
- Date: Thu, 14 Jun 2012 07:48:06 +0000 (UTC)
commit a61311603e6670de140584ee8dd70aeea078cc38
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu May 17 13:50:20 2012 +0200
roster-view: sort items
libempathy-gtk/empathy-roster-view.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 76e74b3..21fabd4 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]