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++)
+ 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 );
bool ThemeLoader::extractZip( const string &zipFile, const string &rootDir )
{
+ bool b_isWsz = strstr( zipFile.c_str(), ".wsz" );
+
// Try to open the ZIP file
unzFile file = unzOpen( zipFile.c_str() );
unz_global_info info;
// Extract all the files in the archive
for( unsigned long i = 0; i < info.number_entry; i++ )
{
- if( !extractFileInZip( file, rootDir ) )
+ if( !extractFileInZip( file, rootDir, b_isWsz ) )
{
msg_Warn( getIntf(), "error while unzipping %s",
zipFile.c_str() );
}
-bool ThemeLoader::extractFileInZip( unzFile file, const string &rootDir )
+bool ThemeLoader::extractFileInZip( unzFile file, const string &rootDir,
+ bool isWsz )
{
// Read info for the current file
char filenameInZip[256];
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++)
- {
- filenameInZip[i] = tolower( filenameInZip[i] );
- }
-
-#endif
+ if( isWsz )
+ for( size_t i = 0; i < strlen( filenameInZip ); i++ )
+ filenameInZip[i] = tolower( filenameInZip[i] );
// Allocate the buffer
void *pBuffer = malloc( ZIP_BUFFER_SIZE );
/**
* Expects a string from the current locale.
*/
- bool extractFileInZip( unzFile file, const string &rootDir );
+ bool extractFileInZip( unzFile file, const string &rootDir, bool isWsz );
/// Clean up the temporary files created by the extraction
/**