Skip to content
Snippets Groups Projects
Commit de095ded authored by Lioncash's avatar Lioncash
Browse files

yuzu/game_list_worker: Don't retrieve file type and file type strings twice in MakeGameListEntry()

While GetFileType() is indeed a getter function, that doesn't mean it's
a trivial function, given some case require reading from the data or
constructing other objects in the background. Instead, only do necessary
work once.
parent de323851
No related branches found
No related tags found
No related merge requests found
......@@ -99,12 +99,14 @@ QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::stri
compatibility = it->second.first;
}
const auto file_type = loader.GetFileType();
const auto file_type_string = QString::fromStdString(Loader::GetFileTypeString(file_type));
QList<QStandardItem*> list{
new GameListItemPath(
FormatGameName(path), icon, QString::fromStdString(name),
QString::fromStdString(Loader::GetFileTypeString(loader.GetFileType())), program_id),
new GameListItemPath(FormatGameName(path), icon, QString::fromStdString(name),
file_type_string, program_id),
new GameListItemCompat(compatibility),
new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader.GetFileType()))),
new GameListItem(file_type_string),
new GameListItemSize(FileUtil::GetSize(path)),
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment