]> git.sesse.net Git - vlc/commitdiff
Skins: "file" shortcut for skins access_demux (& decode URI)
authorJean-Philippe André <jpeg@videolan.org>
Mon, 31 May 2010 05:44:57 +0000 (13:44 +0800)
committerJean-Philippe André <jpeg@videolan.org>
Mon, 31 May 2010 06:04:57 +0000 (14:04 +0800)
Without the shortcut, it is not possible to start the access_demux
for skins, as the full URL is set to file://<path>.vlt

Now we can read skins packages as in earlier versions:
 $ vlc your_skin.vlt

modules/gui/skins2/src/skin_main.cpp
modules/gui/skins2/src/theme_loader.cpp

index 4d9ea1cb8055a1ab09c334c23896fb3ea3412665..5a8b533f8f63e8027066a621c769d17e5c2f85db 100644 (file)
@@ -594,5 +594,6 @@ vlc_module_begin ()
         set_capability( "access_demux", 5 )
         set_callbacks( DemuxOpen, NULL )
         add_shortcut( "skins" )
+        add_shortcut( "file" )
 
 vlc_module_end ()
index 0d9cfd5b9ee7fede21f097417049b9b057588139..1c7968829df9a5425fa053d6d7fc22e8038c4bb3 100644 (file)
@@ -30,6 +30,8 @@
 #include "../src/vlcproc.hpp"
 #include "../src/window_manager.hpp"
 
+#include <vlc_url.h>
+
 #ifdef HAVE_FCNTL_H
 #   include <fcntl.h>
 #endif
@@ -71,8 +73,12 @@ int makedir( const char *newdir );
 #define ZIP_BUFFER_SIZE 4096
 
 
-bool ThemeLoader::load( const string &fileName )
+bool ThemeLoader::load( const string &fullFileName )
 {
+    char *decodedName = decode_URI_duplicate( fullFileName.c_str() );
+    string fileName = decodedName ? string(decodedName) : fullFileName;
+    free( decodedName );
+
     string path = getFilePath( fileName );
 
     //Before all, let's see if the file is present