]> git.sesse.net Git - vlc/commitdiff
Qt4: use make_path
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 20 Feb 2010 18:52:19 +0000 (20:52 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 20 Feb 2010 18:56:10 +0000 (20:56 +0200)
modules/gui/qt4/components/info_panels.cpp
modules/gui/qt4/input_manager.cpp

index cc5c9a13f04050b87c54a843b860b509e71cf8ae..c10caddd20fefbd275c1ecf8ec3bad9346ca1334 100644 (file)
@@ -234,14 +234,13 @@ void MetaPanel::update( input_item_t *p_item )
 
     QString file;
     char *psz_art = input_item_GetArtURL( p_item );
-    if( psz_art && !strncmp( psz_art, "file://", 7 ) &&
-                decode_URI( psz_art + 7 ) )
-#ifdef WIN32
-        file = qfu( psz_art + 8 ); // Remove extra / on Win32 URI.
-#else
-        file = qfu( psz_art + 7 );
-#endif
-    free( psz_art );
+    if( psz_art )
+    {
+        char *psz = make_path( psz_art );
+        free( psz_art );
+        file = qfu( psz );
+        free( psz );
+    }
 
     art_cover->showArtUpdate( file );
 
index 43beda0d8f1f2545e17fcfb3776539bb362712b1..695c81b1bd164a2d4bf3f3897c28db74d6901fab 100644 (file)
@@ -609,20 +609,18 @@ const QString InputManager::decodeArtURL( input_item_t *p_item )
     assert( p_item );
 
     char *psz_art = input_item_GetArtURL( p_item );
-    QString url;
-    if( psz_art && !strncmp( psz_art, "file://", 7 ) &&
-            decode_URI( psz_art + 7 ) )
-#ifdef WIN32
-        url = qfu( psz_art + 8 ); // Remove extra / starting on Win32.
-#else
-        url = qfu( psz_art + 7 );
-#endif
-    free( psz_art );
+    if( psz_art )
+    {
+        char *psz = make_path( psz_art );
+        free( psz_art );
+        psz_art = psz;
+    }
 
-    url = url.replace( "file://", "" );
+#if 0
     /* Taglib seems to define a attachment://, It won't work yet */
     url = url.replace( "attachment://", "" );
-    return url;
+#endif
+    return qfu( psz_art ? psz_art : "" );
 }
 
 void InputManager::UpdateArt()