]> git.sesse.net Git - vlc/commitdiff
skins2: translate $F into local path instead of uri when possible
authorErwan Tulou <erwan10@videolan.org>
Fri, 30 Jul 2010 09:24:19 +0000 (11:24 +0200)
committerErwan Tulou <erwan10@videolan.org>
Sat, 31 Jul 2010 16:05:18 +0000 (18:05 +0200)
Local paths are more user-friendly for display than full uri
when that makes sense

modules/gui/skins2/src/vlcproc.cpp

index a0a0e34f1b3a24875261d0347fc7c1c582ac23b9..13beffaf3a6646bdeb90a05b0ded661fb983494f 100644 (file)
@@ -31,6 +31,7 @@
 #include <vlc_aout.h>
 #include <vlc_vout.h>
 #include <vlc_playlist.h>
+#include <vlc_url.h>
 
 #include "vlcproc.hpp"
 #include "os_factory.hpp"
@@ -476,9 +477,12 @@ void VlcProc::on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal )
     SET_TEXT( m_cVarStreamName, UString( getIntf(), psz_name ) );
     free( psz_name );
 
-    // Update full uri
+    // Update local path (if possible) or full uri
     char *psz_uri = input_item_GetURI( p_item );
-    SET_TEXT( m_cVarStreamURI, UString( getIntf(), psz_uri ) );
+    char *psz_path = make_path( psz_uri );
+    char *psz_save = psz_path ? psz_path : psz_uri;
+    SET_TEXT( m_cVarStreamURI, UString( getIntf(), psz_save ) );
+    free( psz_path );
     free( psz_uri );
 
     // Update art uri