diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-12-11 00:17:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 00:17:11 +0100 |
commit | 11b123ba019b2f7b0b57d5bc28b88964b87c7b9b (patch) | |
tree | 125a1bcaed1398b54a7908ab27cbd51c0770ca3d | |
parent | Merge pull request #12327 from liamwhite/tipc (diff) | |
parent | fs: don't enumerate hidden savedata size file (diff) | |
download | yuzu-11b123ba019b2f7b0b57d5bc28b88964b87c7b9b.tar yuzu-11b123ba019b2f7b0b57d5bc28b88964b87c7b9b.tar.gz yuzu-11b123ba019b2f7b0b57d5bc28b88964b87c7b9b.tar.bz2 yuzu-11b123ba019b2f7b0b57d5bc28b88964b87c7b9b.tar.lz yuzu-11b123ba019b2f7b0b57d5bc28b88964b87c7b9b.tar.xz yuzu-11b123ba019b2f7b0b57d5bc28b88964b87c7b9b.tar.zst yuzu-11b123ba019b2f7b0b57d5bc28b88964b87c7b9b.zip |
-rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 6 | ||||
-rw-r--r-- | src/core/file_sys/savedata_factory.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 8 |
3 files changed, 13 insertions, 5 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index a4d060007..8d5d593e8 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp @@ -12,8 +12,6 @@ namespace FileSys { -constexpr char SAVE_DATA_SIZE_FILENAME[] = ".yuzu_save_size"; - namespace { void PrintSaveDataAttributeWarnings(SaveDataAttribute meta) { @@ -197,7 +195,7 @@ SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id, GetFullPath(system, dir, SaveDataSpaceId::NandUser, type, title_id, user_id, 0); const auto relative_dir = GetOrCreateDirectoryRelative(dir, path); - const auto size_file = relative_dir->GetFile(SAVE_DATA_SIZE_FILENAME); + const auto size_file = relative_dir->GetFile(GetSaveDataSizeFileName()); if (size_file == nullptr || size_file->GetSize() < sizeof(SaveDataSize)) { return {0, 0}; } @@ -216,7 +214,7 @@ void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 us GetFullPath(system, dir, SaveDataSpaceId::NandUser, type, title_id, user_id, 0); const auto relative_dir = GetOrCreateDirectoryRelative(dir, path); - const auto size_file = relative_dir->CreateFile(SAVE_DATA_SIZE_FILENAME); + const auto size_file = relative_dir->CreateFile(GetSaveDataSizeFileName()); if (size_file == nullptr) { return; } diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 45c7c81fb..e3a0f8cef 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h @@ -83,6 +83,10 @@ struct SaveDataSize { u64 journal; }; +constexpr const char* GetSaveDataSizeFileName() { + return ".yuzu_save_size"; +} + /// File system interface to the SaveData archive class SaveDataFactory { public: diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 126cd6ffd..b1310d6e4 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -246,7 +246,13 @@ static void BuildEntryIndex(std::vector<FileSys::Entry>& entries, const std::vec entries.reserve(entries.size() + new_data.size()); for (const auto& new_entry : new_data) { - entries.emplace_back(new_entry->GetName(), type, + auto name = new_entry->GetName(); + + if (type == FileSys::EntryType::File && name == FileSys::GetSaveDataSizeFileName()) { + continue; + } + + entries.emplace_back(name, type, type == FileSys::EntryType::Directory ? 0 : new_entry->GetSize()); } } |