summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorDaniel Garza <danielgarzaf97@gmail.com>2023-02-18 19:08:51 -0600
committerAdmiral H. Curtiss <pikachu025@gmail.com>2023-02-26 19:13:45 +0100
commit02f7c0213f9bb422da0ef270d5f9d35aeac2f90e (patch)
tree60b0bfadbfe937d74663f6f1c3fe849297843976 /Source
parent26adf78e45487bee5b616b41f25e3c4c88b9abea (diff)
Qt/GameList: Also filter by filename when searching.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/GameList/GameListModel.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/GameList/GameListModel.cpp b/Source/Core/DolphinQt/GameList/GameListModel.cpp
index 8eb2124a17..a8276a2fb9 100644
--- a/Source/Core/DolphinQt/GameList/GameListModel.cpp
+++ b/Source/Core/DolphinQt/GameList/GameListModel.cpp
@@ -257,10 +257,19 @@ bool GameListModel::ShouldDisplayGameListItem(int index) const
{
const UICommon::GameFile& game = *m_games[index];
- if (!m_term.isEmpty() &&
- !QString::fromStdString(game.GetName(m_title_database)).contains(m_term, Qt::CaseInsensitive))
+ if (!m_term.isEmpty())
{
- return false;
+ const bool matches_title = QString::fromStdString(game.GetName(m_title_database))
+ .contains(m_term, Qt::CaseInsensitive);
+ const bool filename_visible = Config::Get(Config::MAIN_GAMELIST_COLUMN_FILE_NAME);
+ const bool list_view_selected = Settings::Instance().GetPreferredView();
+ const bool matches_filename =
+ filename_visible && list_view_selected &&
+ QString::fromStdString(game.GetFileName()).contains(m_term, Qt::CaseInsensitive);
+ if (!(matches_title || matches_filename))
+ {
+ return false;
+ }
}
const bool show_platform = [&game] {