diff options
| author | 2016-05-25 16:40:36 -0400 | |
|---|---|---|
| committer | 2016-05-25 16:40:36 -0400 | |
| commit | f50a32bfce099eeff510e5e314b91dcf65d317ac (patch) | |
| tree | 5bc0347199d722861ba09897e6c6e9015cf026bc /src/citra_qt/game_list.cpp | |
| parent | New3DS: Minor style cleanup to #1520. (diff) | |
| parent | Loader: Split SMDH into its own header and import helpers from QGameList (diff) | |
| download | yuzu-f50a32bfce099eeff510e5e314b91dcf65d317ac.tar.gz yuzu-f50a32bfce099eeff510e5e314b91dcf65d317ac.tar.xz yuzu-f50a32bfce099eeff510e5e314b91dcf65d317ac.zip | |
Merge pull request #1817 from linkmauve/smdh-stuff
Improve SMDH support in loaders and frontends
Diffstat (limited to 'src/citra_qt/game_list.cpp')
| -rw-r--r-- | src/citra_qt/game_list.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index d4ac9c96e..570647539 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp | |||
| @@ -132,30 +132,16 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool d | |||
| 132 | if (deep_scan && FileUtil::IsDirectory(physical_name)) { | 132 | if (deep_scan && FileUtil::IsDirectory(physical_name)) { |
| 133 | AddFstEntriesToGameList(physical_name, true); | 133 | AddFstEntriesToGameList(physical_name, true); |
| 134 | } else { | 134 | } else { |
| 135 | std::string filename_filename, filename_extension; | 135 | std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name); |
| 136 | Common::SplitPath(physical_name, nullptr, &filename_filename, &filename_extension); | 136 | if (!loader) |
| 137 | |||
| 138 | Loader::FileType guessed_filetype = Loader::GuessFromExtension(filename_extension); | ||
| 139 | if (guessed_filetype == Loader::FileType::Unknown) | ||
| 140 | return true; | ||
| 141 | Loader::FileType filetype = Loader::IdentifyFile(physical_name); | ||
| 142 | if (filetype == Loader::FileType::Unknown) { | ||
| 143 | LOG_WARNING(Frontend, "File %s is of indeterminate type and is possibly corrupted.", physical_name.c_str()); | ||
| 144 | return true; | 137 | return true; |
| 145 | } | ||
| 146 | if (guessed_filetype != filetype) { | ||
| 147 | LOG_WARNING(Frontend, "Filetype and extension of file %s do not match.", physical_name.c_str()); | ||
| 148 | } | ||
| 149 | 138 | ||
| 150 | std::vector<u8> smdh; | 139 | std::vector<u8> smdh; |
| 151 | std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(FileUtil::IOFile(physical_name, "rb"), filetype, filename_filename, physical_name); | 140 | loader->ReadIcon(smdh); |
| 152 | |||
| 153 | if (loader) | ||
| 154 | loader->ReadIcon(smdh); | ||
| 155 | 141 | ||
| 156 | emit EntryReady({ | 142 | emit EntryReady({ |
| 157 | new GameListItemPath(QString::fromStdString(physical_name), smdh), | 143 | new GameListItemPath(QString::fromStdString(physical_name), smdh), |
| 158 | new GameListItem(QString::fromStdString(Loader::GetFileTypeString(filetype))), | 144 | new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType()))), |
| 159 | new GameListItemSize(FileUtil::GetSize(physical_name)), | 145 | new GameListItemSize(FileUtil::GetSize(physical_name)), |
| 160 | }); | 146 | }); |
| 161 | } | 147 | } |