mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2025-08-07 02:42:33 -07:00
filesystem: De-globalize registered_cache_union
We can just return a new instance of this when it's requested. This only ever holds pointers to the existing registed caches, so it's not a large object. Plus, this also gets rid of the need to keep around a separate member function just to properly clear out the union. Gets rid of one of five globals in the filesystem code.
This commit is contained in:
@@ -97,11 +97,11 @@ GameListWorker::~GameListWorker() = default;
|
||||
|
||||
void GameListWorker::AddInstalledTitlesToGameList() {
|
||||
const auto cache = Service::FileSystem::GetUnionContents();
|
||||
const auto installed_games = cache->ListEntriesFilter(FileSys::TitleType::Application,
|
||||
FileSys::ContentRecordType::Program);
|
||||
const auto installed_games = cache.ListEntriesFilter(FileSys::TitleType::Application,
|
||||
FileSys::ContentRecordType::Program);
|
||||
|
||||
for (const auto& game : installed_games) {
|
||||
const auto file = cache->GetEntryUnparsed(game);
|
||||
const auto file = cache.GetEntryUnparsed(game);
|
||||
std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(file);
|
||||
if (!loader)
|
||||
continue;
|
||||
@@ -112,7 +112,7 @@ void GameListWorker::AddInstalledTitlesToGameList() {
|
||||
loader->ReadProgramId(program_id);
|
||||
|
||||
const FileSys::PatchManager patch{program_id};
|
||||
const auto control = cache->GetEntry(game.title_id, FileSys::ContentRecordType::Control);
|
||||
const auto control = cache.GetEntry(game.title_id, FileSys::ContentRecordType::Control);
|
||||
if (control != nullptr)
|
||||
GetMetadataFromControlNCA(patch, *control, icon, name);
|
||||
|
||||
@@ -141,11 +141,11 @@ void GameListWorker::AddInstalledTitlesToGameList() {
|
||||
emit EntryReady(list);
|
||||
}
|
||||
|
||||
const auto control_data = cache->ListEntriesFilter(FileSys::TitleType::Application,
|
||||
FileSys::ContentRecordType::Control);
|
||||
const auto control_data = cache.ListEntriesFilter(FileSys::TitleType::Application,
|
||||
FileSys::ContentRecordType::Control);
|
||||
|
||||
for (const auto& entry : control_data) {
|
||||
auto nca = cache->GetEntry(entry);
|
||||
auto nca = cache.GetEntry(entry);
|
||||
if (nca != nullptr) {
|
||||
nca_control_map.insert_or_assign(entry.title_id, std::move(nca));
|
||||
}
|
||||
|
@@ -905,7 +905,7 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
|
||||
}
|
||||
|
||||
const auto installed = Service::FileSystem::GetUnionContents();
|
||||
auto romfs_title_id = SelectRomFSDumpTarget(*installed, program_id);
|
||||
const auto romfs_title_id = SelectRomFSDumpTarget(installed, program_id);
|
||||
|
||||
if (!romfs_title_id) {
|
||||
failed();
|
||||
@@ -920,7 +920,7 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
|
||||
if (*romfs_title_id == program_id) {
|
||||
romfs = file;
|
||||
} else {
|
||||
romfs = installed->GetEntry(*romfs_title_id, FileSys::ContentRecordType::Data)->GetRomFS();
|
||||
romfs = installed.GetEntry(*romfs_title_id, FileSys::ContentRecordType::Data)->GetRomFS();
|
||||
}
|
||||
|
||||
const auto extracted = FileSys::ExtractRomFS(romfs, FileSys::RomFSExtractionType::Full);
|
||||
|
Reference in New Issue
Block a user