fspsrv: Implement DisableAutoSaveDataCreation (#6355)

- Used by Mii Edit
This commit is contained in:
Chloe
2021-06-03 10:46:29 +10:00
committed by GitHub
parent 4ea171fa5e
commit c4c256f56a
6 changed files with 25 additions and 2 deletions

View File

@ -105,7 +105,7 @@ ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space,
auto out = dir->GetDirectoryRelative(save_directory);
if (out == nullptr && ShouldSaveDataBeAutomaticallyCreated(space, meta)) {
if (out == nullptr && (ShouldSaveDataBeAutomaticallyCreated(space, meta) && auto_create)) {
return Create(space, meta);
}
@ -199,4 +199,8 @@ void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 us
size_file->WriteObject(new_value);
}
void SaveDataFactory::SetAutoCreate(bool state) {
auto_create = state;
}
} // namespace FileSys

View File

@ -104,9 +104,12 @@ public:
void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id,
SaveDataSize new_value) const;
void SetAutoCreate(bool state);
private:
VirtualDir dir;
Core::System& system;
bool auto_create{true};
};
} // namespace FileSys