changeset 1279:2ebffac54865

unescape url encoded filename where real filename is needed.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Tue, 17 Jul 2007 01:14:36 +0900
parents d1c66f8ccf73
children 1d81217767ab
files src/vorbis/fileinfo.c src/vorbis/vorbis.c
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/vorbis/fileinfo.c	Mon Jul 16 23:47:42 2007 +0900
+++ b/src/vorbis/fileinfo.c	Tue Jul 17 01:14:36 2007 +0900
@@ -1014,8 +1014,12 @@
     gtk_entry_set_text(GTK_ENTRY(location_entry),
                        get_comment(comment, "location"));
 #endif
-                       
-    filename_utf8 = filename_to_utf8(vte.filename);
+    {
+        gchar *realfn = NULL;
+        realfn = g_filename_from_uri(vte.filename, NULL, NULL);
+        filename_utf8 = filename_to_utf8(realfn ? realfn : vte.filename);
+        g_free(realfn); realfn = NULL;
+    }
 
     title = g_strdup_printf(_("%s - Audacious"), g_basename(filename_utf8));
     gtk_window_set_title(GTK_WINDOW(window), title);
--- a/src/vorbis/vorbis.c	Mon Jul 16 23:47:42 2007 +0900
+++ b/src/vorbis/vorbis.c	Tue Jul 17 01:14:36 2007 +0900
@@ -751,12 +751,14 @@
 {
     TitleInput *tuple = NULL;
     vorbis_comment *comment;
-
+    gchar *realfn = NULL;
     tuple = bmp_title_input_new();
 
-    tuple->file_name = g_path_get_basename(filename);
-    tuple->file_ext = get_extension(filename);
-    tuple->file_path = g_path_get_dirname(filename);
+    realfn = g_filename_from_uri(filename, NULL, NULL);
+    tuple->file_name = g_path_get_basename(realfn ? realfn : filename);
+    tuple->file_ext = get_extension(realfn ? realfn : filename);
+    tuple->file_path = g_path_get_dirname(realfn ? realfn : filename);
+    g_free(realfn); realfn = NULL;
 
     /* Retrieve the length */
     if (is_stream == FALSE)