split CreateLocalProfileByID
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user