mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Qt/GameList: Also filter by filename when searching.
This commit is contained in:
parent
26adf78e45
commit
02f7c0213f
@ -257,11 +257,20 @@ bool GameListModel::ShouldDisplayGameListItem(int index) const
|
|||||||
{
|
{
|
||||||
const UICommon::GameFile& game = *m_games[index];
|
const UICommon::GameFile& game = *m_games[index];
|
||||||
|
|
||||||
if (!m_term.isEmpty() &&
|
if (!m_term.isEmpty())
|
||||||
!QString::fromStdString(game.GetName(m_title_database)).contains(m_term, Qt::CaseInsensitive))
|
{
|
||||||
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const bool show_platform = [&game] {
|
const bool show_platform = [&game] {
|
||||||
switch (game.GetPlatform())
|
switch (game.GetPlatform())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user