changeset 2974:b93bd39923bf trunk

Rework DnD received data function to use g_filename_from_uri().
author William Pitcock <nenolod@atheme-project.org>
date Tue, 03 Jul 2007 19:39:46 -0500
parents 8463de0cf728
children 1ec423a12756
files src/audacious/ui_main.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_main.c	Tue Jul 03 07:18:43 2007 -0500
+++ b/src/audacious/ui_main.c	Tue Jul 03 19:39:46 2007 -0500
@@ -1426,7 +1426,7 @@
  * Remove all of this flaky iter/sourcelist/strsplit stuff.
  * All we care about is the filepath.
  *
- * We can figure this out and easily pass it to xmms_urldecode_plain().
+ * We can figure this out and easily pass it to g_filename_from_uri().
  *   - nenolod
  */
 void
@@ -1446,8 +1446,11 @@
 
     if (str_has_prefix_nocase((gchar *) selection_data->data, "fonts:///"))
     {
-        gchar *path = (gchar *) selection_data->data + 9;       /* skip fonts:/// */
-    gchar *decoded = xmms_urldecode_plain(path);
+        gchar *path = (gchar *) selection_data->data;
+        gchar *decoded = g_filename_from_uri(path, NULL, NULL);
+
+        if (decoded == NULL)
+            return;
 
         cfg.playlist_font = g_strconcat(decoded, strrchr(cfg.playlist_font, ' '), NULL);
         playlist_list_set_font(cfg.playlist_font);