From 20bd01c2756797f1d9143b5add03781e711e1a2b Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sat, 30 Jul 2011 13:09:09 -0500 Subject: [PATCH 1/2] * [ProfileManager] Fix an issue when deleting recently created profiles. Fixes issue 119 --- Docs/Changelog_sm5.txt | 4 ++++ src/ProfileManager.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index b51c34600f..65a8160661 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,10 @@ ________________________________________________________________________________ StepMania 5.0 Preview 3 | 20110??? -------------------------------------------------------------------------------- +2011/07/30 +---------- +* [ProfileManager] Fix an issue when deleting recently created profiles. [AJ] + 2011/07/26 ---------- * [ScreenEdit] Add a semi working implementation of the often requested diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 39821a75e1..37c9b76f85 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -482,10 +482,14 @@ bool ProfileManager::RenameLocalProfile( RString sProfileID, RString sNewName ) bool ProfileManager::DeleteLocalProfile( RString sProfileID ) { + LOG->Trace( ssprintf("[ProfileManager::DeleteLocalProfile] delete %s",sProfileID.c_str()) ); Profile *pProfile = ProfileManager::GetLocalProfile( sProfileID ); ASSERT( pProfile ); RString sProfileDir = LocalProfileIDToDir( sProfileID ); + // flush directory cache in an attempt to get this working + FILEMAN->FlushDirCache( sProfileDir ); + FOREACH( DirAndProfile, g_vLocalProfile, i ) { if( i->sDir == sProfileDir ) @@ -504,6 +508,7 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID ) } else { + LOG->Trace( ssprintf("[ProfileManager::DeleteLocalProfile] DeleteRecursive(%s) failed",sProfileID.c_str()) ); return false; } } From 48e8f6ab4921a36b5bac782220ce712522a9d9ea Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sat, 30 Jul 2011 13:10:34 -0500 Subject: [PATCH 2/2] remove unneeded logging --- src/ProfileManager.cpp | 3 +-- src/ScreenOptionsManageProfiles.cpp | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 37c9b76f85..fa1531c316 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -482,7 +482,6 @@ bool ProfileManager::RenameLocalProfile( RString sProfileID, RString sNewName ) bool ProfileManager::DeleteLocalProfile( RString sProfileID ) { - LOG->Trace( ssprintf("[ProfileManager::DeleteLocalProfile] delete %s",sProfileID.c_str()) ); Profile *pProfile = ProfileManager::GetLocalProfile( sProfileID ); ASSERT( pProfile ); RString sProfileDir = LocalProfileIDToDir( sProfileID ); @@ -508,7 +507,7 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID ) } else { - LOG->Trace( ssprintf("[ProfileManager::DeleteLocalProfile] DeleteRecursive(%s) failed",sProfileID.c_str()) ); + LOG->Warn( ssprintf("[ProfileManager::DeleteLocalProfile] DeleteRecursive(%s) failed",sProfileID.c_str()) ); return false; } } diff --git a/src/ScreenOptionsManageProfiles.cpp b/src/ScreenOptionsManageProfiles.cpp index 140177c9c2..adb2cbf917 100644 --- a/src/ScreenOptionsManageProfiles.cpp +++ b/src/ScreenOptionsManageProfiles.cpp @@ -299,7 +299,6 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM ) { RString sTitle = pProfile->m_sDisplayName; RString sMessage = ssprintf( CONFIRM_DELETE_PROFILE.GetValue(), sTitle.c_str() ); - LOG->Trace("[ScreenOptionsManageProfiles] ProfileAction_Delete"); ScreenPrompt::Prompt( SM_BackFromDeleteConfirm, sMessage, PROMPT_YES_NO ); } break;