fix MAX_EDITS_PER_PROFILE
This commit is contained in:
@@ -1185,9 +1185,10 @@ void SongManager::LoadAllFromProfileDir( const CString &sDir, ProfileSlot slot )
|
||||
CStringArray asEditsFilesWithPath;
|
||||
GetDirListing( sEditsDir+"*.edit", asEditsFilesWithPath, false, true );
|
||||
|
||||
unsigned size = min( asEditsFilesWithPath.size(), (unsigned)MAX_EDITS_PER_PROFILE );
|
||||
int iNumEditsLoaded = GetNumEditsLoadedFromProfile( slot );
|
||||
int size = min( (int) asEditsFilesWithPath.size(), MAX_EDITS_PER_PROFILE - iNumEditsLoaded );
|
||||
|
||||
for( unsigned i=0; i<size; i++ )
|
||||
for( int i=0; i<size; i++ )
|
||||
{
|
||||
CString fn = asEditsFilesWithPath[i];
|
||||
|
||||
@@ -1202,6 +1203,25 @@ void SongManager::LoadAllFromProfileDir( const CString &sDir, ProfileSlot slot )
|
||||
}
|
||||
}
|
||||
|
||||
int SongManager::GetNumEditsLoadedFromProfile( ProfileSlot slot ) const
|
||||
{
|
||||
int iCount = 0;
|
||||
for( unsigned s=0; s<m_pSongs.size(); s++ )
|
||||
{
|
||||
const Song *pSong = m_pSongs[s];
|
||||
vector<Steps*> apSteps;
|
||||
pSong->GetSteps( apSteps );
|
||||
|
||||
for( unsigned i = 0; i < apSteps.size(); ++i )
|
||||
{
|
||||
const Steps *pSteps = apSteps[i];
|
||||
if( pSteps->WasLoadedFromProfile() && pSteps->GetLoadedFromProfileSlot() == slot )
|
||||
++iCount;
|
||||
}
|
||||
}
|
||||
return iCount;
|
||||
}
|
||||
|
||||
void SongManager::FreeAllLoadedFromProfile( ProfileSlot slot )
|
||||
{
|
||||
for( unsigned s=0; s<m_pSongs.size(); s++ )
|
||||
|
||||
@@ -105,6 +105,7 @@ protected:
|
||||
Song*& pSongOut, Steps*& pStepsOut, PlayerOptions& po_out, SongOptions& so_out );
|
||||
void SanityCheckGroupDir( CString sDir ) const;
|
||||
void AddGroup( CString sDir, CString sGroupDirName );
|
||||
int GetNumEditsLoadedFromProfile( ProfileSlot slot ) const;
|
||||
|
||||
Song *FindSong( CString sGroup, CString sSong );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user