profile_manager: Add setter for ProfileBase and ProfileData
Needed by IProfileEditor 'Store' and 'StoreWithImage'
This commit is contained in:
parent
39f6d57c34
commit
02560d6482
|
@ -305,6 +305,17 @@ bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ProfileManager::SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
|
||||||
|
const ProfileData& data_new) {
|
||||||
|
const auto index = GetUserIndex(uuid);
|
||||||
|
if (index.has_value() && SetProfileBase(uuid, profile_new)) {
|
||||||
|
profiles[*index].data = data_new;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void ProfileManager::ParseUserSaveFile() {
|
void ProfileManager::ParseUserSaveFile() {
|
||||||
FileUtil::IOFile save(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir) +
|
FileUtil::IOFile save(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir) +
|
||||||
ACC_SAVE_AVATORS_BASE_PATH + "profiles.dat",
|
ACC_SAVE_AVATORS_BASE_PATH + "profiles.dat",
|
||||||
|
|
|
@ -91,6 +91,8 @@ public:
|
||||||
|
|
||||||
bool RemoveUser(Common::UUID uuid);
|
bool RemoveUser(Common::UUID uuid);
|
||||||
bool SetProfileBase(Common::UUID uuid, const ProfileBase& profile_new);
|
bool SetProfileBase(Common::UUID uuid, const ProfileBase& profile_new);
|
||||||
|
bool SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
|
||||||
|
const ProfileData& data_new);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ParseUserSaveFile();
|
void ParseUserSaveFile();
|
||||||
|
|
Reference in New Issue