changeset 2243:58b89671b395

make use of aud_uri_to_display_*()
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Tue, 18 Dec 2007 02:33:00 +0900
parents e8de4c4a3cac
children a95b6a94682d
files src/xspf/xspf.c
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/xspf/xspf.c	Mon Dec 17 22:05:31 2007 +0900
+++ b/src/xspf/xspf.c	Tue Dec 18 02:33:00 2007 +0900
@@ -183,29 +183,24 @@
     }
 
     if (location) {
-        gchar *realfn = NULL, *scratch = NULL;
+        gchar *scratch = NULL;
 
         /* filename and path in tuple must be unescaped. */
-        scratch = g_filename_from_uri(location, NULL, NULL);
-        realfn = aud_str_to_utf8(scratch ? scratch : location);
-        g_free(scratch);
-
-        scratch = g_path_get_basename(realfn);
+        scratch = aud_uri_to_display_basename(location);
         aud_tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch);
         g_free(scratch);
 
-        scratch = g_path_get_dirname(realfn);
+        scratch = aud_uri_to_display_dirname(location);
         aud_tuple_associate_string(tuple, FIELD_FILE_PATH, NULL, scratch);
         g_free(scratch);
 
-        aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, strrchr(realfn, '.'));
+        aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, strrchr(location, '.'));
 
         AUDDBG("tuple->file_name = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
         AUDDBG("tuple->file_path = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_PATH, NULL));
 
         /* add file to playlist */
         aud_playlist_load_ins_file_tuple(playlist, location, filename, pos, tuple);
-        g_free(realfn);
         pos++;
     }