[vlc-devel] commit: skins2: For Linux, correct files that cannot be loaded because of a workaround that only makes sense on Windows . (Erwan Tulou )

git version control git at videolan.org
Fri Jul 10 14:35:12 CEST 2009


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Fri Jul 10 14:07:12 2009 +0200| [4f1060a763f08570961e4e0c049132d855d8644d] | committer: Erwan Tulou 

skins2: For Linux, correct files that cannot be loaded because of a workaround that only makes sense on Windows.

Forcefully setting a file name with lower case was inserted to solve an issue that is only true on Windows. On Linux, upper/lower case must not be tampered with.
This resulted in skins like Orangeade.vlt failing to load their fonts on Linux.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4f1060a763f08570961e4e0c049132d855d8644d
---

 modules/gui/skins2/src/ini_file.cpp     |    5 ++++-
 modules/gui/skins2/src/theme_loader.cpp |    4 ++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/modules/gui/skins2/src/ini_file.cpp b/modules/gui/skins2/src/ini_file.cpp
index c3ff4ec..7fe8282 100644
--- a/modules/gui/skins2/src/ini_file.cpp
+++ b/modules/gui/skins2/src/ini_file.cpp
@@ -66,12 +66,15 @@ void IniFile::parseFile()
                 string var = line.substr( 0, eqPos );
                 string val = line.substr( eqPos + 1, line.size() - eqPos - 1);
 
-                // Convert to lower case because of some buggy winamp2 skins
                 string name = m_name + "." + section + "." + var;
+
+#ifdef WIN32
+                // Convert to lower case because of some buggy winamp2 skins
                 for( size_t i=0; i< name.size(); i++)
                 {
                     name[i] = tolower( name[i] );
                 }
+#endif
 
                 // Register the value in the var manager
                 pVarManager->registerConst( name, val );
diff --git a/modules/gui/skins2/src/theme_loader.cpp b/modules/gui/skins2/src/theme_loader.cpp
index 3f0d106..d02fa71 100644
--- a/modules/gui/skins2/src/theme_loader.cpp
+++ b/modules/gui/skins2/src/theme_loader.cpp
@@ -204,6 +204,8 @@ bool ThemeLoader::extractFileInZip( unzFile file, const string &rootDir )
         return false;
     }
 
+#ifdef WIN32
+
     // Convert the file name to lower case, because some winamp skins
     // use the wrong case...
     for( size_t i=0; i< strlen( filenameInZip ); i++)
@@ -211,6 +213,8 @@ bool ThemeLoader::extractFileInZip( unzFile file, const string &rootDir )
         filenameInZip[i] = tolower( filenameInZip[i] );
     }
 
+#endif
+
     // Allocate the buffer
     void *pBuffer = malloc( ZIP_BUFFER_SIZE );
     if( !pBuffer )




More information about the vlc-devel mailing list