return ID of the created profile

This commit is contained in:
Chris Danford
2005-07-16 05:28:34 +00:00
parent f7ebcc7c34
commit 0bc9261eb3
3 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -322,7 +322,7 @@ Profile &ProfileManager::GetLocalProfile( const CString &sProfileID )
return *iter->second;
}
bool ProfileManager::CreateLocalProfile( CString sName )
bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut )
{
ASSERT( !sName.empty() );
@@ -343,6 +343,10 @@ bool ProfileManager::CreateLocalProfile( CString sName )
return false;
bool bResult = Profile::CreateNewProfile( sProfileDir, sName );
if( bResult )
sProfileIDOut = sProfileID;
else
sProfileIDOut = "";
RefreshLocalProfilesFromDisk();
return bResult;
}
+1 -1
View File
@@ -30,7 +30,7 @@ public:
void RefreshLocalProfilesFromDisk();
Profile &GetLocalProfile( const CString &sProfileID );
bool CreateLocalProfile( CString sName );
bool CreateLocalProfile( CString sName, CString &sProfileIDOut );
bool RenameLocalProfile( CString sProfileID, CString sNewName );
bool DeleteLocalProfile( CString sProfileID );
CString GetNewLocalProfileDefaultName() const;
+1 -1
View File
@@ -87,7 +87,7 @@ void ScreenSelectProfile::HandleScreenMessage( const ScreenMessage SM )
ASSERT( GAMESTATE->m_sLastSelectedProfileID.empty() )
// create
bool bResult = PROFILEMAN->CreateLocalProfile( sNewName );
bool bResult = PROFILEMAN->CreateLocalProfile( sNewName, GAMESTATE->m_sLastSelectedProfileID );
if( bResult )
SCREENMAN->SetNewScreen( NEXT_SCREEN );
else