remove leading slash from CourseID Path and Song Dir for backward compatibility

This commit is contained in:
Chris Danford
2005-05-24 05:26:45 +00:00
parent 1b53028ee1
commit 2888bf0b16
2 changed files with 25 additions and 3 deletions
+12 -1
View File
@@ -379,11 +379,22 @@ void SongID::FromSong( const Song *p )
sDir = p->GetSongDir();
else
sDir = "";
// HACK for backwards compatibility:
// Strip off leading "/". 2005/05/21 file layer changes added a leading slash.
if( sDir.Left(1) == "/" )
sDir.erase( sDir.begin() );
}
Song *SongID::ToSong() const
{
return SONGMAN->GetSongFromDir( sDir );
// HACK for backwards compatibility:
// Re-add the leading "/". 2005/05/21 file layer changes added a leading slash.
CString sDir2 = sDir;
if( sDir2.Left(1) != "/" )
sDir2.erase( sDir2.begin() );
return SONGMAN->GetSongFromDir( sDir2 );
}
XNode* SongID::CreateNode() const