delete profiles without reloading all old ones
This commit is contained in:
@@ -410,11 +410,21 @@ bool ProfileManager::RenameLocalProfile( CString sProfileID, CString sNewName )
|
|||||||
|
|
||||||
bool ProfileManager::DeleteLocalProfile( CString sProfileID )
|
bool ProfileManager::DeleteLocalProfile( CString sProfileID )
|
||||||
{
|
{
|
||||||
CString sProfileDir = LocalProfileIdToDir( sProfileID );
|
map<CString,Profile*>::iterator it = g_mapLocalProfileIdToProfile.find( sProfileID );
|
||||||
bool bResult = DeleteRecursive( sProfileDir );
|
if( it == g_mapLocalProfileIdToProfile.end() )
|
||||||
|
{
|
||||||
|
LOG->Warn( "DeleteLocalProfile: ProfileID '%s' doesn't exist", sProfileID.c_str() );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
RefreshLocalProfilesFromDisk();
|
CString sProfileDir = LocalProfileIdToDir( sProfileID );
|
||||||
return bResult;
|
if( !DeleteRecursive(sProfileDir) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
delete it->second;
|
||||||
|
g_mapLocalProfileIdToProfile.erase( it );
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileManager::SaveMachineProfile() const
|
void ProfileManager::SaveMachineProfile() const
|
||||||
|
|||||||
Reference in New Issue
Block a user