Commit e7e2c948 authored by Olivier Teulière's avatar Olivier Teulière

* skins2/src/theme_loader.cpp: Fixed another directory delimiter issue. The...

 * skins2/src/theme_loader.cpp: Fixed another directory delimiter issue. The winamp skins load perfectly on windows now...
parent 6a0d6da9
......@@ -205,7 +205,9 @@ bool ThemeLoader::extractFileInZip( unzFile file, const string &rootDir )
// Get the path of the file
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
string fullPath = rootDir + pOsFactory->getDirSeparator() + filenameInZip;
string fullPath = rootDir
+ pOsFactory->getDirSeparator()
+ fixDirSeparators( filenameInZip );
string basePath = getFilePath( fullPath );
// Extract the file if is not a directory
......@@ -373,6 +375,21 @@ string ThemeLoader::getFilePath( const string &rFullPath )
}
string ThemeLoader::fixDirSeparators( const string &rPath )
{
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
const string &sep = pOsFactory->getDirSeparator();
string::size_type p = rPath.find( "/", 0 );
string newPath = rPath;
while( p != string::npos )
{
newPath = newPath.replace( p, 1, sep );
p = newPath.find( "/", p + 1 );
}
return newPath;
}
bool ThemeLoader::findFile( const string &rootDir, const string &rFileName,
string &themeFilePath )
{
......
......@@ -69,6 +69,9 @@ class ThemeLoader: public SkinObject
/// Get the base path of a file
string getFilePath( const string &rFullPath );
/// Replace '/' separators by the actual separator of the OS
string fixDirSeparators( const string &rPath );
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment