Revision: 2029
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2029&view=rev
Author:   jcsjcs
Date:     2008-07-05 02:09:13 -0700 (Sat, 05 Jul 2008)

Log Message:
-----------
        * src/file.c: allow absolute paths in coverart
          template. Thanks to J.D. Laub for the patch.

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog
    gtkpod/trunk/src/file.c

Modified: gtkpod/trunk/ChangeLog
===================================================================
--- gtkpod/trunk/ChangeLog      2008-07-05 03:29:03 UTC (rev 2028)
+++ gtkpod/trunk/ChangeLog      2008-07-05 09:09:13 UTC (rev 2029)
@@ -1,5 +1,10 @@
 2008-07-05 Jorg Schuler <jcsjcs at users.sourceforge.net>
 
+       * src/file.c: allow absolute paths in coverart
+          template. Thanks to J.D. Laub for the patch.
+
+2008-07-05 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
        * src/display_itdb.c
          src/display_playlists.c: some work on white space.
 

Modified: gtkpod/trunk/src/file.c
===================================================================
--- gtkpod/trunk/src/file.c     2008-07-05 03:29:03 UTC (rev 2028)
+++ gtkpod/trunk/src/file.c     2008-07-05 09:09:13 UTC (rev 2029)
@@ -1171,7 +1171,10 @@
        {
            if (strchr (*tplp, '.') != NULL)
            {   /* if template has an extension, try if it is valid */
-               filename_utf8 = g_build_filename (dirname, fname, NULL);
+               if (fname[0] == '/')
+                   filename_utf8 = g_build_filename ("", fname, NULL);
+               else
+                   filename_utf8 = g_build_filename (dirname, fname, NULL);
                filename_local = charset_from_utf8 (filename_utf8);
                g_free (filename_utf8);
                if (!g_file_test (filename_local, G_FILE_TEST_EXISTS))
@@ -1186,7 +1189,11 @@
                while (*extp && !filename_local)
                {
                    gchar *ffname = g_strconcat (fname, *extp, NULL);
-                   filename_utf8 = g_build_filename (dirname, ffname, NULL);
+                   if (ffname[0] == '/')
+                       filename_utf8 = g_build_filename ("", ffname, NULL);
+                   else
+                       filename_utf8 = g_build_filename (dirname, ffname,
+                           NULL);
                    g_free (ffname);
                    filename_local = charset_from_utf8 (filename_utf8);
                    g_free (filename_utf8);
@@ -1203,7 +1210,11 @@
                    gchar *upper_ext = g_ascii_strup (*extp, -1);
                    gchar *ffname = g_strconcat (fname, upper_ext, NULL);
                    g_free (upper_ext);
-                   filename_utf8 = g_build_filename (dirname, ffname, NULL);
+                   if (ffname[0] == '/')
+                       filename_utf8 = g_build_filename ("", ffname, NULL);
+                   else
+                       filename_utf8 = g_build_filename (dirname, ffname,
+                           NULL);
                    g_free (ffname);
                    filename_local = charset_from_utf8 (filename_utf8);
                    g_free (filename_utf8);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to