# HG changeset patch # User Christian Birchinger # Date 1186750093 -7200 # Node ID eaf68ed9816609ae87f1a1ec814ec3c3d8ce89bb # Parent 1588a64f020467a68886c738cb2b1efcd2a0c2de Use real filenames inside tuples not URIs diff -r 1588a64f0204 -r eaf68ed98166 src/audacious/tuple.c --- a/src/audacious/tuple.c Fri Aug 10 14:39:53 2007 +0200 +++ b/src/audacious/tuple.c Fri Aug 10 14:48:13 2007 +0200 @@ -86,7 +86,7 @@ Tuple * tuple_new_from_filename(gchar *filename) { - gchar *scratch, *ext; + gchar *scratch, *ext, *realfn; Tuple *tuple; g_return_val_if_fail(filename != NULL, NULL); @@ -94,21 +94,25 @@ tuple = tuple_new(); g_return_val_if_fail(tuple != NULL, NULL); - - scratch = g_path_get_basename(filename); + + realfn = g_filename_from_uri(filename, NULL, NULL); + + scratch = g_path_get_basename(realfn ? realfn : filename); tuple_associate_string(tuple, "file-name", scratch); g_free(scratch); - scratch = g_path_get_dirname(filename); + scratch = g_path_get_dirname(realfn ? realfn : filename); tuple_associate_string(tuple, "file-path", scratch); g_free(scratch); - + + g_free(realfn); realfn = NULL; + ext = strrchr(filename, '.'); if (ext != NULL) { ++ext; tuple_associate_string(tuple, "file-ext", scratch); } - + return tuple; }