[gnome-games] games-page: Explicitly clear selected_games on select_none()



commit 32b7feaa0fe75a44725ab45b8f889f74db0a370c
Author: Neville <nevilleantony98 gmail com>
Date:   Tue Jun 30 13:25:15 2020 +0530

    games-page: Explicitly clear selected_games on select_none()
    
    This is useful when games are removed from a collection being viewed.
    When a game is removed from a collection, its GameIconView's checked
    state cannot be updated because the game is removed from the GameModel
    and the corresponding GameIconView is no longer available for setting
    the checked prop to false. And so the game remains in the selected_games
    set even after removal. We can call remove_all() on selected_games to
    ensure it will always clear the selected_games set.

 src/ui/games-page.vala | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/ui/games-page.vala b/src/ui/games-page.vala
index 2f1987f6..a78ddf08 100644
--- a/src/ui/games-page.vala
+++ b/src/ui/games-page.vala
@@ -151,6 +151,8 @@ private class Games.GamesPage : Gtk.Bin {
        public void select_none () {
                foreach (var game_icon_view in selected_games.get_values ())
                        game_icon_view.checked = false;
+
+               selected_games.remove_all ();
        }
 
        public void select_all () {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]