Jenny Rom bug: fix songs with '=' in the pathname not being loaded from cache.

This commit is contained in:
Glenn Maynard
2003-09-16 05:16:57 +00:00
parent e5b84a402b
commit 60a871439c
2 changed files with 12 additions and 2 deletions
+10 -2
View File
@@ -55,13 +55,21 @@ void SongCacheIndex::ReadCacheIndex()
void SongCacheIndex::AddCacheIndex(const CString &path, unsigned hash)
{
CacheIndex.SetValueI( "Cache", "CacheVersion", FILE_CACHE_VERSION );
CacheIndex.SetValueU( "Cache", path, hash );
CacheIndex.SetValueU( "Cache", MangleName(path), hash );
CacheIndex.WriteFile();
}
unsigned SongCacheIndex::GetCacheHash( const CString &path ) const
{
unsigned iDirHash;
CacheIndex.GetValueU( "Cache", path, iDirHash );
CacheIndex.GetValueU( "Cache", MangleName(path), iDirHash );
return iDirHash;
}
CString SongCacheIndex::MangleName( const CString &Name )
{
/* We store paths in an INI. We can't store '='. */
CString ret = Name;
ret.Replace( "=", "");
return ret;
}
+2
View File
@@ -5,6 +5,8 @@
class SongCacheIndex {
IniFile CacheIndex;
static CString MangleName( const CString &Name );
public:
SongCacheIndex();
~SongCacheIndex();