mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 03:32:55 +00:00
Qt: Look for custom game titles when filtering via Search
This commit is contained in:
parent
7fcef227af
commit
95f363c174
@ -290,8 +290,9 @@ bool game_list_frame::IsEntryVisible(const game_info& game)
|
||||
return category::CategoryInMap(game->info.category, category::cat_boot);
|
||||
};
|
||||
|
||||
bool is_visible = m_show_hidden || !m_hidden_list.contains(qstr(game->info.serial));
|
||||
return is_visible && matches_category() && SearchMatchesApp(game->info.name, game->info.serial);
|
||||
const QString serial = qstr(game->info.serial);
|
||||
bool is_visible = m_show_hidden || !m_hidden_list.contains(serial);
|
||||
return is_visible && matches_category() && SearchMatchesApp(qstr(game->info.name), serial);
|
||||
}
|
||||
|
||||
void game_list_frame::SortGameList()
|
||||
@ -2057,12 +2058,17 @@ void game_list_frame::PopulateGameGrid(int maxCols, const QSize& image_size, con
|
||||
/**
|
||||
* Returns false if the game should be hidden because it doesn't match search term in toolbar.
|
||||
*/
|
||||
bool game_list_frame::SearchMatchesApp(const std::string& name, const std::string& serial)
|
||||
bool game_list_frame::SearchMatchesApp(const QString& name, const QString& serial) const
|
||||
{
|
||||
if (!m_search_text.isEmpty())
|
||||
{
|
||||
QString searchText = m_search_text.toLower();
|
||||
return qstr(name).toLower().contains(searchText) || qstr(serial).toLower().contains(searchText);
|
||||
const QString searchText = m_search_text.toLower();
|
||||
QString gameName = m_titles[serial];
|
||||
if (gameName.isEmpty())
|
||||
{
|
||||
gameName = name;
|
||||
}
|
||||
return gameName.toLower().contains(searchText) || serial.toLower().contains(searchText);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ private:
|
||||
void SortGameList();
|
||||
|
||||
int PopulateGameList();
|
||||
bool SearchMatchesApp(const std::string& name, const std::string& serial);
|
||||
bool SearchMatchesApp(const QString& name, const QString& serial) const;
|
||||
|
||||
bool RemoveCustomConfiguration(const std::string& title_id, game_info game = nullptr, bool is_interactive = false);
|
||||
bool RemoveCustomPadConfiguration(const std::string& title_id, game_info game = nullptr, bool is_interactive = false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user