From: Erwan Tulou Date: Fri, 10 Jul 2009 12:07:12 +0000 (+0200) Subject: skins2: For Linux, correct files that cannot be loaded because of a workaround that... X-Git-Tag: 1.1.0-ff~5040 X-Git-Url: http://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=commitdiff_plain;h=4f1060a763f08570961e4e0c049132d855d8644d 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. --- diff --git a/modules/gui/skins2/src/ini_file.cpp b/modules/gui/skins2/src/ini_file.cpp index c3ff4ec319..7fe8282eb6 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 3f0d106271..d02fa718e1 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 )