Mercurial > audlegacy
changeset 3099:4f011bf1d083
branch merge
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Thu, 19 Jul 2007 11:17:41 +0200 |
parents | 821a712c08a3 (current diff) bb1fa0aed8f4 (diff) |
children | 38ca234df0d9 |
files | |
diffstat | 2 files changed, 44 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/playlist.c Thu Jul 19 11:16:38 2007 +0200 +++ b/src/audacious/playlist.c Thu Jul 19 11:17:41 2007 +0200 @@ -1501,9 +1501,13 @@ title = str_to_utf8(playlist->position->title); } else { - gchar *basename = g_path_get_basename(playlist->position->filename); + gchar *realfn = NULL; + gchar *basename = NULL; + realfn = g_filename_from_uri(playlist->position->filename, NULL, NULL); + basename = g_path_get_basename(realfn ? realfn : playlist->position->filename); title = filename_to_utf8(basename); - g_free(basename); + g_free(realfn); realfn = NULL; + g_free(basename); basename = NULL; } /*
--- a/src/audacious/ui_jumptotrack.c Thu Jul 19 11:16:38 2007 +0200 +++ b/src/audacious/ui_jumptotrack.c Thu Jul 19 11:17:41 2007 +0200 @@ -277,21 +277,24 @@ PlaylistEntry *entry = PLAYLIST_ENTRY(playlist_glist->data); if (entry->title) - desc_buf = g_strdup(entry->title); - else if (strchr(entry->filename, '/')) - desc_buf = str_to_utf8(strrchr(entry->filename, '/') + 1); - else - desc_buf = str_to_utf8(entry->filename); + desc_buf = g_strdup(entry->title); + else { + gchar *realfn = NULL; + realfn = g_filename_from_uri(entry->filename, NULL, NULL); + if (strchr(realfn ? realfn : entry->filename, '/')) + desc_buf = str_to_utf8(strrchr(realfn ? realfn : entry->filename, '/') + 1); + else + desc_buf = str_to_utf8(realfn ? realfn : entry->filename); + g_free(realfn); realfn = NULL; + } gtk_list_store_append(GTK_LIST_STORE(store), &iter); gtk_list_store_set(GTK_LIST_STORE(store), &iter, 0, row, 1, desc_buf, -1); row++; - if(desc_buf) { - g_free(desc_buf); - desc_buf = NULL; - } + g_free(desc_buf); + desc_buf = NULL; } gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter); @@ -350,13 +353,17 @@ playlist_glist = g_list_next(playlist_glist)) { PlaylistEntry *entry = PLAYLIST_ENTRY(playlist_glist->data); - const gchar *title=NULL; - gchar *filename = NULL; - filename = str_to_utf8(entry->filename); + gchar *title = NULL; + if (entry->title) - title = entry->title; - else - title = filename; + title = g_strdup(entry->title); + else { + gchar *realfn = NULL; + realfn = g_filename_from_uri(entry->filename, NULL, NULL); + title = str_to_utf8(realfn ? realfn : entry->filename); + g_free(realfn); realfn = NULL; + } + /*we are matching all the path not just the filename or title*/ /* Compare the reg.expressions to the string - if all the @@ -379,21 +386,21 @@ if (match) { if (entry->title) - title = g_strdup(entry->title); - else if (strchr(entry->filename, '/')) - title = str_to_utf8(strrchr(entry->filename, '/') + 1); - else - title = str_to_utf8(entry->filename); - + title = g_strdup(entry->title); + else { + gchar *realfn = NULL; + realfn = g_filename_from_uri(entry->filename, NULL, NULL); + if (strchr(realfn ? realfn : entry->filename, '/')) + title = str_to_utf8(strrchr(realfn ? realfn : entry->filename, '/') + 1); + else + title = str_to_utf8(realfn ? realfn : entry->filename); + g_free(realfn); realfn = NULL; + } gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, song_index + 1 , 1, title, -1); } song_index++; - - if (filename) { - g_free(filename); - filename = NULL; - } + g_free(title); title = NULL; } PLAYLIST_UNLOCK(playlist->mutex); @@ -449,18 +456,16 @@ PlaylistEntry *entry = PLAYLIST_ENTRY(playlist_glist->data); if (entry->title) - desc_buf = g_strdup(entry->title); - else if (strchr(entry->filename, '/')) { + desc_buf = g_strdup(entry->title); + else { gchar *realfn = NULL; realfn = g_filename_from_uri(entry->filename, NULL, NULL); - if(realfn) - desc_buf = str_to_utf8(strrchr(realfn, '/') + 1); + if (strchr(realfn ? realfn : entry->filename, '/')) + desc_buf = str_to_utf8(strrchr(realfn ? realfn : entry->filename, '/') + 1); else - desc_buf = str_to_utf8(strrchr(entry->filename, '/') + 1); + desc_buf = str_to_utf8(realfn ? realfn : entry->filename); g_free(realfn); realfn = NULL; } - else - desc_buf = str_to_utf8(entry->filename); gtk_list_store_append(GTK_LIST_STORE(jtf_store), &iter); gtk_list_store_set(GTK_LIST_STORE(jtf_store), &iter,