summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-01 18:14:10 +0200
committerGitHub <noreply@github.com>2021-05-01 18:14:10 +0200
commit03b3c5800bc06655a1e50a016c7051214f5de981 (patch)
treeee83a9b662f5ffac1d3d2644649671dce7ddf10a
parentMerge pull request #6264 from german77/touchsetting (diff)
parentgame_list: Update filter results when removing directories (diff)
downloadyuzu-03b3c5800bc06655a1e50a016c7051214f5de981.tar
yuzu-03b3c5800bc06655a1e50a016c7051214f5de981.tar.gz
yuzu-03b3c5800bc06655a1e50a016c7051214f5de981.tar.bz2
yuzu-03b3c5800bc06655a1e50a016c7051214f5de981.tar.lz
yuzu-03b3c5800bc06655a1e50a016c7051214f5de981.tar.xz
yuzu-03b3c5800bc06655a1e50a016c7051214f5de981.tar.zst
yuzu-03b3c5800bc06655a1e50a016c7051214f5de981.zip
-rw-r--r--src/yuzu/game_list.cpp9
-rw-r--r--src/yuzu/game_list_p.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 48b78d65f..827bc10e7 100644
--- 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());
});
}
@@ -774,7 +775,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 100644
--- 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();