changeset 3079:72766f2e8713

recursive directory scan for add file dialog works again
author Giacomo Lozito <james@develia.org>
date Sun, 15 Jul 2007 20:02:21 +0200
parents 407395e030c7
children 5dc103115dab
files src/audacious/playlist.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Sat Jul 14 14:56:38 2007 -0500
+++ b/src/audacious/playlist.c	Sun Jul 15 20:02:21 2007 +0200
@@ -823,6 +823,9 @@
     struct stat statbuf;
     DeviceInode *devino;
 
+    if (!path)
+        return NULL;
+
     if (!vfs_file_test(path, G_FILE_TEST_IS_DIR))
         return NULL;
 
@@ -848,6 +851,7 @@
         return list;
     }
 
+    /* g_dir_open does not handle URI, so path should come here not-urified. --giacomo */
     if (!(dir = g_dir_open(path, 0, NULL)))
         return NULL;
 
@@ -863,7 +867,9 @@
 
         if (vfs_file_test(filename, G_FILE_TEST_IS_DIR)) {
             GList *sub;
-            sub = playlist_dir_find_files(filename, background, htab);
+            gchar *dirfilename = g_filename_from_uri(filename, NULL, NULL);
+            sub = playlist_dir_find_files(dirfilename, background, htab);
+            g_free(dirfilename);
             g_free(filename);
             list = g_list_concat(list, sub);
         }