summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/game_list.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/game_list.cpp')
-rw-r--r--src/citra_qt/game_list.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp
index d14532102..570647539 100644
--- a/src/citra_qt/game_list.cpp
+++ b/src/citra_qt/game_list.cpp
@@ -34,8 +34,8 @@ GameList::GameList(QWidget* parent)
tree_view->setUniformRowHeights(true);
item_model->insertColumns(0, COLUMN_COUNT);
- item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, "File type");
item_model->setHeaderData(COLUMN_NAME, Qt::Horizontal, "Name");
+ item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, "File type");
item_model->setHeaderData(COLUMN_SIZE, Qt::Horizontal, "Size");
connect(tree_view, SIGNAL(activated(const QModelIndex&)), this, SLOT(ValidateEntry(const QModelIndex&)));
@@ -109,7 +109,11 @@ void GameList::SaveInterfaceLayout()
void GameList::LoadInterfaceLayout()
{
auto header = tree_view->header();
- header->restoreState(UISettings::values.gamelist_header_state);
+ if (!header->restoreState(UISettings::values.gamelist_header_state)) {
+ // We are using the name column to display icons and titles
+ // so make it as large as possible as default.
+ header->resizeSection(COLUMN_NAME, header->width());
+ }
item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder());
}
@@ -128,24 +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;
+ loader->ReadIcon(smdh);
emit EntryReady({
- new GameListItem(QString::fromStdString(Loader::GetFileTypeString(filetype))),
- new GameListItemPath(QString::fromStdString(physical_name)),
+ new GameListItemPath(QString::fromStdString(physical_name), smdh),
+ new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType()))),
new GameListItemSize(FileUtil::GetSize(physical_name)),
});
}