allow unloading steps from a specific profile
This commit is contained in:
@@ -1359,7 +1359,7 @@ bool Song::Matches(CString sGroup, CString sSong) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Song::FreeAllLoadedFromProfiles()
|
void Song::FreeAllLoadedFromProfile( ProfileSlot slot )
|
||||||
{
|
{
|
||||||
/* RemoveSteps will remove and recreate autogen notes, which may reorder
|
/* RemoveSteps will remove and recreate autogen notes, which may reorder
|
||||||
* m_vpSteps, so be careful not to skip over entries. */
|
* 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-- )
|
for( int s=m_vpSteps.size()-1; s>=0; s-- )
|
||||||
{
|
{
|
||||||
Steps* pSteps = m_vpSteps[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 );
|
apToRemove.push_back( pSteps );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1219,7 +1219,7 @@ void SongManager::FreeAllLoadedFromProfiles()
|
|||||||
for( unsigned s=0; s<m_pSongs.size(); s++ )
|
for( unsigned s=0; s<m_pSongs.size(); s++ )
|
||||||
{
|
{
|
||||||
Song* pSong = m_pSongs[s];
|
Song* pSong = m_pSongs[s];
|
||||||
pSong->FreeAllLoadedFromProfiles();
|
pSong->FreeAllLoadedFromProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
// After freeing some Steps pointers, the cache will be invalid.
|
// After freeing some Steps pointers, the cache will be invalid.
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ public:
|
|||||||
void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps!
|
void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps!
|
||||||
void RemoveSteps( const Steps* pSteps );
|
void RemoveSteps( const Steps* pSteps );
|
||||||
|
|
||||||
void FreeAllLoadedFromProfiles();
|
void FreeAllLoadedFromProfile( ProfileSlot slot = PROFILE_SLOT_INVALID );
|
||||||
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; }
|
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; }
|
||||||
int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const;
|
int GetNumStepsLoadedFromProfile( ProfileSlot slot ) const;
|
||||||
bool IsEditAlreadyLoaded( Steps* pSteps ) const;
|
bool IsEditAlreadyLoaded( Steps* pSteps ) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user