summaryrefslogtreecommitdiff
path: root/src/yuzu/game_list.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-08-16 17:08:44 -0400
committerZach Hilman <zachhilman@gmail.com>2018-08-23 11:53:30 -0400
commit60b7a3b90448daf2eb0dabd6edadf42e50b3f5b6 (patch)
treebe9595212bd36ec5e5f6305b2ac3e74dcb1c3799 /src/yuzu/game_list.cpp
parentab44192ab01a27115e14a52d4823722cbd357c0d (diff)
game_list: Add SD registration loading to game list
Diffstat (limited to 'src/yuzu/game_list.cpp')
-rw-r--r--src/yuzu/game_list.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index d5726b8b3..867a3c6f1 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -426,13 +426,12 @@ static void GetMetadataFromControlNCA(const std::shared_ptr<FileSys::NCA>& nca,
}
}
-void GameListWorker::AddInstalledTitlesToGameList() {
- const auto usernand = Service::FileSystem::GetUserNANDContents();
- const auto installed_games = usernand->ListEntriesFilter(FileSys::TitleType::Application,
- FileSys::ContentRecordType::Program);
+void GameListWorker::AddInstalledTitlesToGameList(std::shared_ptr<FileSys::RegisteredCache> cache) {
+ const auto installed_games = cache->ListEntriesFilter(FileSys::TitleType::Application,
+ FileSys::ContentRecordType::Program);
for (const auto& game : installed_games) {
- const auto& file = usernand->GetEntryRaw(game);
+ const auto& file = cache->GetEntryUnparsed(game);
std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(file);
if (!loader)
continue;
@@ -442,8 +441,7 @@ void GameListWorker::AddInstalledTitlesToGameList() {
u64 program_id = 0;
loader->ReadProgramId(program_id);
- const auto& control =
- usernand->GetEntry(game.title_id, FileSys::ContentRecordType::Control);
+ const auto& control = cache->GetEntry(game.title_id, FileSys::ContentRecordType::Control);
if (control != nullptr)
GetMetadataFromControlNCA(control, icon, name);
emit EntryReady({
@@ -457,11 +455,11 @@ void GameListWorker::AddInstalledTitlesToGameList() {
});
}
- const auto control_data = usernand->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) {
- const auto nca = usernand->GetEntry(entry);
+ const auto nca = cache->GetEntry(entry);
if (nca != nullptr)
nca_control_map.insert_or_assign(entry.title_id, nca);
}
@@ -549,7 +547,9 @@ void GameListWorker::run() {
stop_processing = false;
watch_list.append(dir_path);
FillControlMap(dir_path.toStdString());
- AddInstalledTitlesToGameList();
+ AddInstalledTitlesToGameList(Service::FileSystem::GetUserNANDContents());
+ AddInstalledTitlesToGameList(Service::FileSystem::GetSystemNANDContents());
+ AddInstalledTitlesToGameList(Service::FileSystem::GetSDMCContents());
AddFstEntriesToGameList(dir_path.toStdString(), deep_scan ? 256 : 0);
nca_control_map.clear();
emit Finished(watch_list);