split CreateLocalProfileByID

This commit is contained in:
Glenn Maynard
2005-08-11 23:10:44 +00:00
parent 01b6345758
commit 3c93754969
2 changed files with 17 additions and 6 deletions
+16 -6
View File
@@ -371,15 +371,25 @@ bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut )
int iProfileNumber = iMaxProfileNumber + 1;
CString sProfileID = ssprintf( "%08d", iProfileNumber );
CString sProfileDir = LocalProfileIdToDir( sProfileID );
bool bResult = Profile::CreateNewProfile( sProfileDir, sName, true );
if( bResult )
sProfileIDOut = sProfileID;
else
if( !CreateLocalProfileByID(sName, sProfileID) )
{
sProfileIDOut = "";
return false;
}
sProfileIDOut = sProfileID;
return true;
}
bool ProfileManager::CreateLocalProfileByID( CString sName, CString sProfileID )
{
CString sProfileDir = LocalProfileIdToDir( sProfileID );
if( !Profile::CreateNewProfile(sProfileDir, sName, true) )
return false;
RefreshLocalProfilesFromDisk();
return bResult;
return true;
}
bool ProfileManager::RenameLocalProfile( CString sProfileID, CString sNewName )
+1
View File
@@ -32,6 +32,7 @@ public:
Profile &GetLocalProfile( const CString &sProfileID );
bool CreateLocalProfile( CString sName, CString &sProfileIDOut );
bool CreateLocalProfileByID( CString sName, CString sProfileID );
bool RenameLocalProfile( CString sProfileID, CString sNewName );
bool DeleteLocalProfile( CString sProfileID );
void GetLocalProfileIDs( vector<CString> &vsProfileIDsOut ) const;