summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-12-05 23:58:11 +0100
committerLioncash <mathew1800@gmail.com>2018-12-05 23:58:15 +0100
commit01bf329f63446d6dee4e88d75b827970eea037f6 (patch)
tree5dc2da92771a89e346aad3e99014b0310523a73d
parentyuzu/game_list_worker: Don't retrieve file type and file type strings twice in MakeGameListEntry() (diff)
downloadyuzu-01bf329f63446d6dee4e88d75b827970eea037f6.tar
yuzu-01bf329f63446d6dee4e88d75b827970eea037f6.tar.gz
yuzu-01bf329f63446d6dee4e88d75b827970eea037f6.tar.bz2
yuzu-01bf329f63446d6dee4e88d75b827970eea037f6.tar.lz
yuzu-01bf329f63446d6dee4e88d75b827970eea037f6.tar.xz
yuzu-01bf329f63446d6dee4e88d75b827970eea037f6.tar.zst
yuzu-01bf329f63446d6dee4e88d75b827970eea037f6.zip
-rw-r--r--src/yuzu/game_list_worker.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp
index f16a6e41c..20f5e8798 100644
--- a/src/yuzu/game_list_worker.cpp
+++ b/src/yuzu/game_list_worker.cpp
@@ -198,12 +198,16 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
const bool is_dir = FileUtil::IsDirectory(physical_name);
if (!is_dir &&
(HasSupportedFileExtension(physical_name) || IsExtractedNCAMain(physical_name))) {
- std::unique_ptr<Loader::AppLoader> loader =
- Loader::GetLoader(vfs->OpenFile(physical_name, FileSys::Mode::Read));
- if (!loader || ((loader->GetFileType() == Loader::FileType::Unknown ||
- loader->GetFileType() == Loader::FileType::Error) &&
- !UISettings::values.show_unknown))
+ auto loader = Loader::GetLoader(vfs->OpenFile(physical_name, FileSys::Mode::Read));
+ if (!loader) {
return true;
+ }
+
+ const auto file_type = loader->GetFileType();
+ if ((file_type == Loader::FileType::Unknown || file_type == Loader::FileType::Error) &&
+ !UISettings::values.show_unknown) {
+ return true;
+ }
std::vector<u8> icon;
const auto res1 = loader->ReadIcon(icon);