summaryrefslogtreecommitdiffstats
path: root/src/citra_qt
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-05-18 23:06:50 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-05-21 18:09:59 +0200
commit314ce5e505aca066ad4d0385be46d7e8de9f6dfb (patch)
treee71b47815cf82006ea78b9820b5df5f99f8380b9 /src/citra_qt
parentLoader: Add a GetFileType method to get the type of a loaded file (diff)
downloadyuzu-314ce5e505aca066ad4d0385be46d7e8de9f6dfb.tar
yuzu-314ce5e505aca066ad4d0385be46d7e8de9f6dfb.tar.gz
yuzu-314ce5e505aca066ad4d0385be46d7e8de9f6dfb.tar.bz2
yuzu-314ce5e505aca066ad4d0385be46d7e8de9f6dfb.tar.lz
yuzu-314ce5e505aca066ad4d0385be46d7e8de9f6dfb.tar.xz
yuzu-314ce5e505aca066ad4d0385be46d7e8de9f6dfb.tar.zst
yuzu-314ce5e505aca066ad4d0385be46d7e8de9f6dfb.zip
Diffstat (limited to 'src/citra_qt')
-rw-r--r--src/citra_qt/game_list.cpp22
-rw-r--r--src/citra_qt/main.cpp2
2 files changed, 5 insertions, 19 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
if (deep_scan && FileUtil::IsDirectory(physical_name)) {
AddFstEntriesToGameList(physical_name, true);
} else {
- std::string filename_filename, filename_extension;
- Common::SplitPath(physical_name, nullptr, &filename_filename, &filename_extension);
-
- Loader::FileType guessed_filetype = Loader::GuessFromExtension(filename_extension);
- if (guessed_filetype == Loader::FileType::Unknown)
- return true;
- Loader::FileType filetype = Loader::IdentifyFile(physical_name);
- if (filetype == Loader::FileType::Unknown) {
- LOG_WARNING(Frontend, "File %s is of indeterminate type and is possibly corrupted.", physical_name.c_str());
+ std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name);
+ if (!loader)
return true;
- }
- if (guessed_filetype != filetype) {
- LOG_WARNING(Frontend, "Filetype and extension of file %s do not match.", physical_name.c_str());
- }
std::vector<u8> smdh;
- std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(FileUtil::IOFile(physical_name, "rb"), filetype, filename_filename, physical_name);
-
- if (loader)
- loader->ReadIcon(smdh);
+ loader->ReadIcon(smdh);
emit EntryReady({
new GameListItemPath(QString::fromStdString(physical_name), smdh),
- new GameListItem(QString::fromStdString(Loader::GetFileTypeString(filetype))),
+ new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType()))),
new GameListItemSize(FileUtil::GetSize(physical_name)),
});
}
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 9d47014aa..6239160bc 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -272,7 +272,7 @@ bool GMainWindow::InitializeSystem() {
}
bool GMainWindow::LoadROM(const std::string& filename) {
- std::unique_ptr<Loader::AppLoader> app_loader = Loader::GetFileLoader(filename);
+ std::unique_ptr<Loader::AppLoader> app_loader = Loader::GetLoader(filename);
if (!app_loader) {
LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filename.c_str());
QMessageBox::critical(this, tr("Error while loading ROM!"),