summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4c13d5)
raw | patch | inline | side by side (parent: e4c13d5)
author | Kalle Wallin <kaw@linux.se> | |
Thu, 16 Jun 2005 23:32:47 +0000 (23:32 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Thu, 16 Jun 2005 23:32:47 +0000 (23:32 +0000) |
src/screen_artist.c | patch | blob | history |
diff --git a/src/screen_artist.c b/src/screen_artist.c
index 8909638b05e866a7fae8896ee2887bbdf57dedbf..085c6aac1bea5afa2be3c1833d70599286b18f88 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
static GList *metalist = NULL;
static list_window_state_t *lw_state = NULL;
+static gint
+compare_utf8(gconstpointer s1, gconstpointer s2)
+{
+ char *key1, *key2;
+ int n;
+
+ key1 = g_utf8_collate_key(s1,-1);
+ key2 = g_utf8_collate_key(s2,-1);
+ n = strcmp(key1,key2);
+ g_free(key1);
+ g_free(key2);
+ return n;
+}
+
/* list_window callback */
static char *
artist_lw_callback(int index, int *highlight, void *data)
{
artist = m_artist;
metalist = mpdclient_get_albums_utf8(c, m_artist);
+ /* sort list */
+ metalist = g_list_sort(metalist, compare_utf8);
/* add a dummy entry for ".." */
metalist = g_list_insert(metalist, g_strdup(".."), 0);
/* add a dummy entry for all songs */
else /* retreive artists... */
{
metalist = mpdclient_get_artists_utf8(c);
+ /* sort list */
+ metalist = g_list_sort(metalist, compare_utf8);
mode = LIST_ARTISTS;
}
metalist_length = g_list_length(metalist);