diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/loader/deconstructed_rom_directory.h | 2 | ||||
| -rw-r--r-- | src/core/loader/elf.h | 2 | ||||
| -rw-r--r-- | src/core/loader/loader.h | 2 | ||||
| -rw-r--r-- | src/core/loader/nax.cpp | 2 | ||||
| -rw-r--r-- | src/core/loader/nax.h | 2 | ||||
| -rw-r--r-- | src/core/loader/nca.h | 2 | ||||
| -rw-r--r-- | src/core/loader/nro.h | 2 | ||||
| -rw-r--r-- | src/core/loader/nso.h | 2 | ||||
| -rw-r--r-- | src/core/loader/nsp.h | 2 | ||||
| -rw-r--r-- | src/core/loader/xci.h | 2 | ||||
| -rw-r--r-- | src/yuzu/game_list_worker.cpp | 24 |
11 files changed, 25 insertions, 19 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.h b/src/core/loader/deconstructed_rom_directory.h index d109ed2b5..1615cb5a8 100644 --- a/src/core/loader/deconstructed_rom_directory.h +++ b/src/core/loader/deconstructed_rom_directory.h | |||
| @@ -33,7 +33,7 @@ public: | |||
| 33 | */ | 33 | */ |
| 34 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 34 | static FileType IdentifyType(const FileSys::VirtualFile& file); |
| 35 | 35 | ||
| 36 | FileType GetFileType() override { | 36 | FileType GetFileType() const override { |
| 37 | return IdentifyType(file); | 37 | return IdentifyType(file); |
| 38 | } | 38 | } |
| 39 | 39 | ||
diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h index 6af76441c..a2d33021c 100644 --- a/src/core/loader/elf.h +++ b/src/core/loader/elf.h | |||
| @@ -22,7 +22,7 @@ public: | |||
| 22 | */ | 22 | */ |
| 23 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 23 | static FileType IdentifyType(const FileSys::VirtualFile& file); |
| 24 | 24 | ||
| 25 | FileType GetFileType() override { | 25 | FileType GetFileType() const override { |
| 26 | return IdentifyType(file); | 26 | return IdentifyType(file); |
| 27 | } | 27 | } |
| 28 | 28 | ||
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 7686634bf..5390ab9ee 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h | |||
| @@ -131,7 +131,7 @@ public: | |||
| 131 | * Returns the type of this file | 131 | * Returns the type of this file |
| 132 | * @return FileType corresponding to the loaded file | 132 | * @return FileType corresponding to the loaded file |
| 133 | */ | 133 | */ |
| 134 | virtual FileType GetFileType() = 0; | 134 | virtual FileType GetFileType() const = 0; |
| 135 | 135 | ||
| 136 | /** | 136 | /** |
| 137 | * Load the application and return the created Process instance | 137 | * Load the application and return the created Process instance |
diff --git a/src/core/loader/nax.cpp b/src/core/loader/nax.cpp index 42f4a777b..a093e3d36 100644 --- a/src/core/loader/nax.cpp +++ b/src/core/loader/nax.cpp | |||
| @@ -37,7 +37,7 @@ FileType AppLoader_NAX::IdentifyType(const FileSys::VirtualFile& file) { | |||
| 37 | return IdentifyTypeImpl(nax); | 37 | return IdentifyTypeImpl(nax); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | FileType AppLoader_NAX::GetFileType() { | 40 | FileType AppLoader_NAX::GetFileType() const { |
| 41 | return IdentifyTypeImpl(*nax); | 41 | return IdentifyTypeImpl(*nax); |
| 42 | } | 42 | } |
| 43 | 43 | ||
diff --git a/src/core/loader/nax.h b/src/core/loader/nax.h index b4d93bd01..0a97511b8 100644 --- a/src/core/loader/nax.h +++ b/src/core/loader/nax.h | |||
| @@ -31,7 +31,7 @@ public: | |||
| 31 | */ | 31 | */ |
| 32 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 32 | static FileType IdentifyType(const FileSys::VirtualFile& file); |
| 33 | 33 | ||
| 34 | FileType GetFileType() override; | 34 | FileType GetFileType() const override; |
| 35 | 35 | ||
| 36 | ResultStatus Load(Kernel::Process& process) override; | 36 | ResultStatus Load(Kernel::Process& process) override; |
| 37 | 37 | ||
diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h index 95d9b73a1..cbbe701d2 100644 --- a/src/core/loader/nca.h +++ b/src/core/loader/nca.h | |||
| @@ -29,7 +29,7 @@ public: | |||
| 29 | */ | 29 | */ |
| 30 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 30 | static FileType IdentifyType(const FileSys::VirtualFile& file); |
| 31 | 31 | ||
| 32 | FileType GetFileType() override { | 32 | FileType GetFileType() const override { |
| 33 | return IdentifyType(file); | 33 | return IdentifyType(file); |
| 34 | } | 34 | } |
| 35 | 35 | ||
diff --git a/src/core/loader/nro.h b/src/core/loader/nro.h index 6deff3a51..013d629c0 100644 --- a/src/core/loader/nro.h +++ b/src/core/loader/nro.h | |||
| @@ -33,7 +33,7 @@ public: | |||
| 33 | */ | 33 | */ |
| 34 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 34 | static FileType IdentifyType(const FileSys::VirtualFile& file); |
| 35 | 35 | ||
| 36 | FileType GetFileType() override { | 36 | FileType GetFileType() const override { |
| 37 | return IdentifyType(file); | 37 | return IdentifyType(file); |
| 38 | } | 38 | } |
| 39 | 39 | ||
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h index 0c1defbb6..135b6ea5a 100644 --- a/src/core/loader/nso.h +++ b/src/core/loader/nso.h | |||
| @@ -37,7 +37,7 @@ public: | |||
| 37 | */ | 37 | */ |
| 38 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 38 | static FileType IdentifyType(const FileSys::VirtualFile& file); |
| 39 | 39 | ||
| 40 | FileType GetFileType() override { | 40 | FileType GetFileType() const override { |
| 41 | return IdentifyType(file); | 41 | return IdentifyType(file); |
| 42 | } | 42 | } |
| 43 | 43 | ||
diff --git a/src/core/loader/nsp.h b/src/core/loader/nsp.h index db91cd01e..9ed8a59cf 100644 --- a/src/core/loader/nsp.h +++ b/src/core/loader/nsp.h | |||
| @@ -31,7 +31,7 @@ public: | |||
| 31 | */ | 31 | */ |
| 32 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 32 | static FileType IdentifyType(const FileSys::VirtualFile& file); |
| 33 | 33 | ||
| 34 | FileType GetFileType() override { | 34 | FileType GetFileType() const override { |
| 35 | return IdentifyType(file); | 35 | return IdentifyType(file); |
| 36 | } | 36 | } |
| 37 | 37 | ||
diff --git a/src/core/loader/xci.h b/src/core/loader/xci.h index 46f8dfc9e..ded5bb88a 100644 --- a/src/core/loader/xci.h +++ b/src/core/loader/xci.h | |||
| @@ -31,7 +31,7 @@ public: | |||
| 31 | */ | 31 | */ |
| 32 | static FileType IdentifyType(const FileSys::VirtualFile& file); | 32 | static FileType IdentifyType(const FileSys::VirtualFile& file); |
| 33 | 33 | ||
| 34 | FileType GetFileType() override { | 34 | FileType GetFileType() const override { |
| 35 | return IdentifyType(file); | 35 | return IdentifyType(file); |
| 36 | } | 36 | } |
| 37 | 37 | ||
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index 9fd074223..20f5e8798 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp | |||
| @@ -99,12 +99,14 @@ QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::stri | |||
| 99 | compatibility = it->second.first; | 99 | compatibility = it->second.first; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | const auto file_type = loader.GetFileType(); | ||
| 103 | const auto file_type_string = QString::fromStdString(Loader::GetFileTypeString(file_type)); | ||
| 104 | |||
| 102 | QList<QStandardItem*> list{ | 105 | QList<QStandardItem*> list{ |
| 103 | new GameListItemPath( | 106 | new GameListItemPath(FormatGameName(path), icon, QString::fromStdString(name), |
| 104 | FormatGameName(path), icon, QString::fromStdString(name), | 107 | file_type_string, program_id), |
| 105 | QString::fromStdString(Loader::GetFileTypeString(loader.GetFileType())), program_id), | ||
| 106 | new GameListItemCompat(compatibility), | 108 | new GameListItemCompat(compatibility), |
| 107 | new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader.GetFileType()))), | 109 | new GameListItem(file_type_string), |
| 108 | new GameListItemSize(FileUtil::GetSize(path)), | 110 | new GameListItemSize(FileUtil::GetSize(path)), |
| 109 | }; | 111 | }; |
| 110 | 112 | ||
| @@ -196,12 +198,16 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign | |||
| 196 | const bool is_dir = FileUtil::IsDirectory(physical_name); | 198 | const bool is_dir = FileUtil::IsDirectory(physical_name); |
| 197 | if (!is_dir && | 199 | if (!is_dir && |
| 198 | (HasSupportedFileExtension(physical_name) || IsExtractedNCAMain(physical_name))) { | 200 | (HasSupportedFileExtension(physical_name) || IsExtractedNCAMain(physical_name))) { |
| 199 | std::unique_ptr<Loader::AppLoader> loader = | 201 | auto loader = Loader::GetLoader(vfs->OpenFile(physical_name, FileSys::Mode::Read)); |
| 200 | Loader::GetLoader(vfs->OpenFile(physical_name, FileSys::Mode::Read)); | 202 | if (!loader) { |
| 201 | if (!loader || ((loader->GetFileType() == Loader::FileType::Unknown || | ||
| 202 | loader->GetFileType() == Loader::FileType::Error) && | ||
| 203 | !UISettings::values.show_unknown)) | ||
| 204 | return true; | 203 | return true; |
| 204 | } | ||
| 205 | |||
| 206 | const auto file_type = loader->GetFileType(); | ||
| 207 | if ((file_type == Loader::FileType::Unknown || file_type == Loader::FileType::Error) && | ||
| 208 | !UISettings::values.show_unknown) { | ||
| 209 | return true; | ||
| 210 | } | ||
| 205 | 211 | ||
| 206 | std::vector<u8> icon; | 212 | std::vector<u8> icon; |
| 207 | const auto res1 = loader->ReadIcon(icon); | 213 | const auto res1 = loader->ReadIcon(icon); |