[gnome-music/wip/mschraal/gtk4: 97/102] albumsview: Fix select all/none



commit 913f4e5cd475ebde38594e0662d87640e8986742
Author: Marinus Schraal <mschraal gnome org>
Date:   Mon Jun 8 01:54:23 2020 +0200

    albumsview: Fix select all/none
    
    Use the model directly due to container changes

 gnomemusic/views/albumsview.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index 26f6fca7..619b0c9e 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -67,8 +67,8 @@ class AlbumsView(Gtk.Stack):
         self._widget_counter = 1
         self._ctrl_hold = False
 
-        model = self._application.props.coremodel.props.albums_sort
-        self._flowbox.bind_model(model, self._create_widget)
+        self._model = self._application.props.coremodel.props.albums_sort
+        self._flowbox.bind_model(self._model, self._create_widget)
         self._flowbox.set_hadjustment(self._scrolled_window.get_hadjustment())
         self._flowbox.set_vadjustment(self._scrolled_window.get_vadjustment())
         self._flowbox.connect("child-activated", self._on_child_activated)
@@ -250,8 +250,8 @@ class AlbumsView(Gtk.Stack):
                 else:
                     self._album_widget.deselect_all()
             else:
-                for child in self._flowbox.get_children():
-                    child.props.selected = selected
+                for corealbum in self._model:
+                    corealbum.props.selected = selected
 
     def select_all(self):
         self._toggle_all_selection(True)


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