allow unloading steps from a specific profile

This commit is contained in:
Glenn Maynard
2005-04-25 00:05:42 +00:00
parent 8f831ffb85
commit dcafde0088
3 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -1359,7 +1359,7 @@ bool Song::Matches(CString sGroup, CString sSong) const
return false;
}
void Song::FreeAllLoadedFromProfiles()
void Song::FreeAllLoadedFromProfile( ProfileSlot slot )
{
/* RemoveSteps will remove and recreate autogen notes, which may reorder
* m_vpSteps, so be careful not to skip over entries. */
@@ -1367,7 +1367,9 @@ void Song::FreeAllLoadedFromProfiles()
for( int s=m_vpSteps.size()-1; s>=0; s-- )
{
Steps* pSteps = m_vpSteps[s];
if( pSteps->WasLoadedFromProfile() )
if( !pSteps->WasLoadedFromProfile() )
continue;
if( slot == PROFILE_SLOT_INVALID || pSteps->GetLoadedFromProfileSlot() == slot )
apToRemove.push_back( pSteps );
}
+1 -1
View File
@@ -1219,7 +1219,7 @@ void SongManager::FreeAllLoadedFromProfiles()
for( unsigned s=0; s<m_pSongs.size(); s++ )
{
Song* pSong = m_pSongs[s];
pSong->FreeAllLoadedFromProfiles();
pSong->FreeAllLoadedFromProfile();
}
// After freeing some Steps pointers, the cache will be invalid.
+1 -1
View File
@@ -215,7 +215,7 @@ public:
void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps!
void RemoveSteps( const Steps* pSteps );
void FreeAllLoadedFromProfiles();
void FreeAllLoadedFromProfile( ProfileSlot slot = PROFILE_SLOT_INVALID );
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; }
int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const;
bool IsEditAlreadyLoaded( Steps* pSteps ) const;