split CreateLocalProfileByID
This commit is contained in:
@@ -371,15 +371,25 @@ bool ProfileManager::CreateLocalProfile( CString sName, CString &sProfileIDOut )
|
|||||||
|
|
||||||
int iProfileNumber = iMaxProfileNumber + 1;
|
int iProfileNumber = iMaxProfileNumber + 1;
|
||||||
CString sProfileID = ssprintf( "%08d", iProfileNumber );
|
CString sProfileID = ssprintf( "%08d", iProfileNumber );
|
||||||
CString sProfileDir = LocalProfileIdToDir( sProfileID );
|
|
||||||
|
|
||||||
bool bResult = Profile::CreateNewProfile( sProfileDir, sName, true );
|
if( !CreateLocalProfileByID(sName, sProfileID) )
|
||||||
if( bResult )
|
{
|
||||||
sProfileIDOut = sProfileID;
|
|
||||||
else
|
|
||||||
sProfileIDOut = "";
|
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();
|
RefreshLocalProfilesFromDisk();
|
||||||
return bResult;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProfileManager::RenameLocalProfile( CString sProfileID, CString sNewName )
|
bool ProfileManager::RenameLocalProfile( CString sProfileID, CString sNewName )
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public:
|
|||||||
Profile &GetLocalProfile( const CString &sProfileID );
|
Profile &GetLocalProfile( const CString &sProfileID );
|
||||||
|
|
||||||
bool CreateLocalProfile( CString sName, CString &sProfileIDOut );
|
bool CreateLocalProfile( CString sName, CString &sProfileIDOut );
|
||||||
|
bool CreateLocalProfileByID( CString sName, CString sProfileID );
|
||||||
bool RenameLocalProfile( CString sProfileID, CString sNewName );
|
bool RenameLocalProfile( CString sProfileID, CString sNewName );
|
||||||
bool DeleteLocalProfile( CString sProfileID );
|
bool DeleteLocalProfile( CString sProfileID );
|
||||||
void GetLocalProfileIDs( vector<CString> &vsProfileIDsOut ) const;
|
void GetLocalProfileIDs( vector<CString> &vsProfileIDsOut ) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user