[gnome-music/wip/mschraal/searchview-selection-fixes: 4/4] albumsview: Use Application object directly



commit bada493da26b765fce9b4a1899e04599004a5ec2
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Feb 11 15:07:33 2020 +0100

    albumsview: Use Application object directly

 gnomemusic/views/albumsview.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index f48dc117..7fc34e92 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -59,6 +59,7 @@ class AlbumsView(Gtk.Stack):
         self.name = "albums"
         self.title = _("Albums")
 
+        self._application = application
         self._window = application.props.window
         self._headerbar = self._window._headerbar
         self._adjustment_timeout_id = None
@@ -228,7 +229,7 @@ class AlbumsView(Gtk.Stack):
         if self.props.selection_mode is False:
             self.props.selection_mode = True
 
-        with self._window._app.props.coreselection.freeze_notify():
+        with self._application.props.coreselection.freeze_notify():
             if self._ctrl_hold is False:
                 self.deselect_all()
             for child in self._flowbox.get_selected_children():
@@ -243,7 +244,7 @@ class AlbumsView(Gtk.Stack):
     def _toggle_all_selection(self, selected):
         """Selects or deselects all items.
         """
-        with self._window._app.props.coreselection.freeze_notify():
+        with self._application.props.coreselection.freeze_notify():
             if self.get_visible_child() == self._album_widget:
                 if selected is True:
                     self._album_widget.select_all()


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