[Xfce4-commits] <parole:master> Fix Parole doesn't load video from cmd if file name contains a space after a colon (bug #10236)
Sean Davis
noreply at xfce.org
Tue Jul 23 23:08:01 CEST 2013
Updating branch refs/heads/master
to e3ecd9c0107631b7006fadd8b51e16383392886b (commit)
from 62239051174178d19b8fd1f2a906c1bdbf9f8762 (commit)
commit e3ecd9c0107631b7006fadd8b51e16383392886b
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Tue Jul 23 17:06:41 2013 -0400
Fix Parole doesn't load video from cmd if file name contains a space after a colon (bug #10236)
src/parole-medialist.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index fe301bc..678eb82 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -347,7 +347,7 @@ parole_media_list_files_open (ParoleMediaList *list, GSList *files, gboolean dis
NULL);
len = g_slist_length (files);
- TRACE ("Adding files");
+ TRACE ("Adding %i files", len);
if ( len > 1 )
g_signal_emit (G_OBJECT (list), signals [SHOW_PLAYLIST], 0, TRUE);
@@ -1807,19 +1807,36 @@ parole_media_list_add_by_path (ParoleMediaList *list, const gchar *path, gboolea
GtkFileFilter *filter;
guint len;
gboolean ret = FALSE;
+ gchar *full_path;
filter = parole_get_supported_media_filter ();
g_object_ref_sink (filter);
- TRACE ("Path=%s", path);
+ if (g_path_is_absolute(path)) {
+ full_path = g_strdup(path);
+ }
+ else
+ {
+ if (g_file_test( g_strjoin("/", g_get_current_dir(), g_strdup(path), NULL), G_FILE_TEST_EXISTS))
+ {
+ full_path = g_strjoin("/", g_get_current_dir(), g_strdup(path), NULL);
+ }
+ else
+ {
+ full_path = g_strdup(path);
+ }
+ }
+ TRACE ("Path=%s", full_path);
- parole_get_media_files (filter, path, TRUE, &files_list);
+ parole_get_media_files (filter, full_path, TRUE, &files_list);
parole_media_list_files_open (list, files_list, FALSE, emit);
len = g_slist_length (files_list);
ret = len == 0 ? FALSE : TRUE;
+ g_free(full_path);
+
g_object_unref (filter);
g_slist_free (files_list);
return ret;
More information about the Xfce4-commits
mailing list