diff src/audacious/input.c @ 3081:ba2143c1c6f5

unescape url encoded filename where real filename is needed.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Tue, 17 Jul 2007 00:31:43 +0900
parents 84de3244aeaa
children 35e560fa183f
line wrap: on
line diff
--- a/src/audacious/input.c	Mon Jul 16 00:02:11 2007 +0200
+++ b/src/audacious/input.c	Tue Jul 17 00:31:43 2007 +0900
@@ -532,12 +532,14 @@
 
     gchar *title, *fileinfo, *basename, *iplugin;
     gchar *filename_utf8;
+    gchar *realfn = NULL;
 
     window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
     gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
 
-    basename = g_path_get_basename(filename);
+    realfn = g_filename_from_uri(filename, NULL, NULL);
+    basename = g_path_get_basename(realfn ? realfn : filename);
     fileinfo = filename_to_utf8(basename);
     title = g_strdup_printf(_("audacious: %s"), fileinfo);
 
@@ -559,7 +561,8 @@
     gtk_box_pack_start(GTK_BOX(filename_hbox), label, FALSE, TRUE, 0);
 
     filename_entry = gtk_entry_new();
-    filename_utf8 = filename_to_utf8(filename);
+    filename_utf8 = filename_to_utf8(realfn ? realfn : filename);
+    g_free(realfn); realfn = NULL;
 
     gtk_entry_set_text(GTK_ENTRY(filename_entry), filename_utf8);
     gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE);