From 67c21bcba9ccd35aa643bd67c0b71941142a9f36 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sat, 1 May 2021 19:07:04 +0200 Subject: [PATCH] early-access version 1646 --- README.md | 2 +- src/yuzu/game_list.cpp | 9 +++++---- src/yuzu/game_list_p.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d7f9c80a3..1d702f486 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1645. +This is the source code for early-access 1646. ## Legal Notice diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 5ff3932dc..63cf82f7d 100755 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -85,8 +85,8 @@ void GameListSearchField::setFilterResult(int visible, int total) { label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible)); } -bool GameListSearchField::isEmpty() const { - return edit_filter->text().isEmpty(); +QString GameListSearchField::filterText() const { + return edit_filter->text(); } QString GameList::GetLastFilterResultItem() const { @@ -236,9 +236,9 @@ void GameList::OnTextChanged(const QString& new_text) { } else { tree_view->setRowHidden(j, folder_index, true); } - search_field->setFilterResult(result_count, children_total); } } + search_field->setFilterResult(result_count, children_total); } } @@ -595,6 +595,7 @@ void GameList::AddCustomDirPopup(QMenu& context_menu, QModelIndex selected) { connect(delete_dir, &QAction::triggered, [this, &game_dir, selected] { UISettings::values.game_dirs.removeOne(game_dir); item_model->invisibleRootItem()->removeRow(selected.row()); + OnTextChanged(search_field->filterText()); }); } @@ -776,7 +777,7 @@ void GameList::RefreshGameDirectory() { void GameList::ToggleFavorite(u64 program_id) { if (!UISettings::values.favorited_ids.contains(program_id)) { tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), - !search_field->isEmpty()); + !search_field->filterText().isEmpty()); UISettings::values.favorited_ids.append(program_id); AddFavorite(program_id); item_model->sort(tree_view->header()->sortIndicatorSection(), diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 7ca8ece23..978d27325 100755 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -346,8 +346,8 @@ class GameListSearchField : public QWidget { public: explicit GameListSearchField(GameList* parent = nullptr); + QString filterText() const; void setFilterResult(int visible, int total); - bool isEmpty() const; void clear(); void setFocus();