Browse Source
[desktop] Clean up game list code, fix external watcher crash, and fix macOS flickering (#4106)
[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>pull/4109/head
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
12 changed files with 181 additions and 277 deletions
-
7CMakeLists.txt
-
52src/qt_common/game_list/game_list_p.h
-
81src/qt_common/game_list/model.cpp
-
9src/qt_common/game_list/model.h
-
81src/qt_common/game_list/worker.cpp
-
3src/yuzu/CMakeLists.txt
-
36src/yuzu/game/common.h
-
20src/yuzu/game/game_grid.cpp
-
126src/yuzu/game/game_list.cpp
-
6src/yuzu/game/game_list.h
-
26src/yuzu/game/game_tree.cpp
-
11src/yuzu/main_window.cpp
@ -0,0 +1,36 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project |
|||
// SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include <QStandardItem> |
|||
#include <QStringList> |
|||
|
|||
#include "qt_common/game_list/game_list_p.h" |
|||
|
|||
namespace Yuzu { |
|||
|
|||
inline bool 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); }); |
|||
} |
|||
|
|||
inline bool FilterMatches(const QString& filter, const QStandardItem* item) { |
|||
if (filter.isEmpty()) |
|||
return true; |
|||
|
|||
const auto program_id = item->data(GameListItemPath::ProgramIdRole).toULongLong(); |
|||
|
|||
const QString file_path = item->data(GameListItemPath::FullPathRole).toString().toLower(); |
|||
const QString file_title = item->data(GameListItemPath::TitleRole).toString().toLower(); |
|||
const QString file_program_id = QStringLiteral("%1").arg(program_id, 16, 16, QLatin1Char{'0'}); |
|||
|
|||
const QString file_name = |
|||
file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + QLatin1Char{' '} + file_title; |
|||
|
|||
return Yuzu::ContainsAllWords(file_name, filter) || |
|||
(file_program_id.size() == 16 && file_program_id.contains(filter)); |
|||
} |
|||
|
|||
} // namespace Yuzu |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue