[empathy: 15/19] Sort presets alphabetically in the list



commit 7a94f85d284baebdd3bbc0607205d3ced82748a2
Author: Davyd Madeley <davyd madeley id au>
Date:   Thu Apr 23 19:30:48 2009 +0800

    Sort presets alphabetically in the list
---
 libempathy-gtk/empathy-presence-chooser.c     |    3 ++-
 libempathy-gtk/empathy-status-preset-dialog.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index d565cf3..d97abea 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -170,7 +170,8 @@ presence_chooser_create_model (EmpathyPresenceChooser *self)
 		if (states[i+1]) {
 
 			/* Set custom messages if wanted */
-			list = empathy_status_presets_get (states[i], 5);
+			list = empathy_status_presets_get (states[i], -1);
+			list = g_list_sort (list, (GCompareFunc) g_utf8_collate);
 			for (l = list; l; l = l->next) {
 				gtk_list_store_insert_with_values (store,
 					NULL, -1,
diff --git a/libempathy-gtk/empathy-status-preset-dialog.c b/libempathy-gtk/empathy-status-preset-dialog.c
index 562b9e4..d8416a5 100644
--- a/libempathy-gtk/empathy-status-preset-dialog.c
+++ b/libempathy-gtk/empathy-status-preset-dialog.c
@@ -108,8 +108,9 @@ status_preset_dialog_presets_update (EmpathyStatusPresetDialog *self)
 		GList *presets, *l;
 		const char *icon_name;
 
-		presets = empathy_status_presets_get (states[i], -1);
 		icon_name = empathy_icon_name_for_presence (states[i]);
+		presets = empathy_status_presets_get (states[i], -1);
+		presets = g_list_sort (presets, (GCompareFunc) g_utf8_collate);
 
 		for (l = presets; l; l = l->next) {
 			char *preset = (char *) l->data;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]