diff options
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 6 | ||||
| -rw-r--r-- | src/core/file_sys/savedata_factory.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index 6c3685927..b5254dd75 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp | |||
| @@ -105,7 +105,7 @@ ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, | |||
| 105 | 105 | ||
| 106 | auto out = dir->GetDirectoryRelative(save_directory); | 106 | auto out = dir->GetDirectoryRelative(save_directory); |
| 107 | 107 | ||
| 108 | if (out == nullptr && ShouldSaveDataBeAutomaticallyCreated(space, meta)) { | 108 | if (out == nullptr && (ShouldSaveDataBeAutomaticallyCreated(space, meta) && auto_create)) { |
| 109 | return Create(space, meta); | 109 | return Create(space, meta); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| @@ -199,4 +199,8 @@ void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 us | |||
| 199 | size_file->WriteObject(new_value); | 199 | size_file->WriteObject(new_value); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | void SaveDataFactory::SetAutoCreate(bool state) { | ||
| 203 | auto_create = state; | ||
| 204 | } | ||
| 205 | |||
| 202 | } // namespace FileSys | 206 | } // namespace FileSys |
diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 86c9f5350..1d8dc981f 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h | |||
| @@ -104,9 +104,12 @@ public: | |||
| 104 | void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, | 104 | void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, |
| 105 | SaveDataSize new_value) const; | 105 | SaveDataSize new_value) const; |
| 106 | 106 | ||
| 107 | void SetAutoCreate(bool state); | ||
| 108 | |||
| 107 | private: | 109 | private: |
| 108 | VirtualDir dir; | 110 | VirtualDir dir; |
| 109 | Core::System& system; | 111 | Core::System& system; |
| 112 | bool auto_create{true}; | ||
| 110 | }; | 113 | }; |
| 111 | 114 | ||
| 112 | } // namespace FileSys | 115 | } // namespace FileSys |