diff options
| author | crueter <crueter@eden-emu.dev> | 2026-06-19 22:55:29 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-06-19 22:55:29 +0200 |
| commit | 102d2545303daa926f39e5cf6518c6ce99c7918d (patch) | |
| tree | ab5653bc5989530929f49c10e20024ea16a313a0 /src/yuzu/game/game_grid.cpp | |
| parent | 7c0e993b5b905224fd4d290485deaee30c685f0d (diff) | |
[desktop] Clean up game list code, fix external watcher crash, and fix macOS flickering (#4106)
- Remove unnecessary icon update code (the UI reloads this stuff anyways); test on Windows please
- Cleaned up a bunch of duplicated/unused code within the game list
- Fix the game list constantly reloading on macOS
* When you reconstruct the entire directory list on the watcher the directoryChanged signal fires on macOS--seems like a behavioral change that occurred somewhere in the 6.8 release cycle--and it would enter an infinite loop very quickly
* To fix this, only the differences between the current and old watch list are accounted for on both ends.
* Since this bug is now fixed, macOS uses Qt 6.11.1 now. Should theoretically improve our situation.
- Fix the external content watcher crashing; the worker would attempt to read files that didn't exist without any bounds since its cache was still pointing to that file.
This supersedes and replaces #4099.
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4106
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Diffstat (limited to 'src/yuzu/game/game_grid.cpp')
| -rw-r--r-- | src/yuzu/game/game_grid.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/yuzu/game/game_grid.cpp b/src/yuzu/game/game_grid.cpp index 88e4a205a8..ab8a3d8bfe 100644 --- a/src/yuzu/game/game_grid.cpp +++ b/src/yuzu/game/game_grid.cpp @@ -5,10 +5,10 @@ #include <QScrollerProperties> #include "qt_common/config/uisettings.h" +#include "qt_common/game_list/model.h" +#include "yuzu/game/common.h" #include "yuzu/game/game_card.h" #include "yuzu/game/game_grid.h" -#include "qt_common/game_list/game_list_p.h" -#include "qt_common/game_list/model.h" GameGrid::GameGrid(QWidget* parent) : QListView{parent} { m_gameCard = new GameCard(this); @@ -43,26 +43,12 @@ void GameGrid::SetModel(GameListModel* model) { void GameGrid::ApplyFilter(const QString& edit_filter_text, GameListModel* model) { int row_count = model->rowCount(); - auto ContainsAllWords = [](const QString& haystack, const QString& userinput) { - const QStringList userinput_split = - userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts); - return std::all_of(userinput_split.begin(), userinput_split.end(), - [&haystack](const QString& s) { return haystack.contains(s); }); - }; - for (int i = 0; i < row_count; ++i) { QStandardItem* item = model->item(i, 0); if (!item) continue; - const QString file_path = - item->data(GameListItemPath::FullPathRole).toString().toLower(); - const QString file_title = - item->data(GameListItemPath::TitleRole).toString().toLower(); - const QString file_name = file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + - QLatin1Char{' '} + file_title; - - if (edit_filter_text.isEmpty() || ContainsAllWords(file_name, edit_filter_text)) { + if (Yuzu::FilterMatches(edit_filter_text, item)) { setRowHidden(i, false); } else { setRowHidden(i, true); |
