[gnome-music/wip/mschraal/baseview-cleanup: 1/5] baseview: Remove unused functions



commit 69ef458333df585d7372da4b2334fce949429216
Author: Marinus Schraal <mschraal gnome org>
Date:   Wed Jul 17 16:09:16 2019 +0200

    baseview: Remove unused functions

 gnomemusic/views/albumsview.py  |  7 -------
 gnomemusic/views/artistsview.py |  8 --------
 gnomemusic/views/baseview.py    |  4 ----
 gnomemusic/views/songsview.py   | 17 +++--------------
 4 files changed, 3 insertions(+), 33 deletions(-)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index b2b1e90e..83147e73 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -59,13 +59,6 @@ class AlbumsView(BaseView):
         self.connect(
             "notify::search-mode-active", self._on_search_mode_changed)
 
-    @log
-    def _on_selection_mode_changed(self, widget, data=None):
-        super()._on_selection_mode_changed(widget, data)
-
-        if not self.props.selection_mode:
-            self._on_changes_pending()
-
     @log
     def _on_search_mode_changed(self, klass, param):
         if (not self.props.search_mode_active
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index 09c04635..446ac6aa 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -134,14 +134,6 @@ class ArtistsView(BaseView):
             vhomogeneous=False)
         self._view_container.add(self._view)
 
-    @log
-    def _on_changes_pending(self, data=None):
-        if (self._init
-                and not self.props.selection_mode):
-            self._artists.clear()
-            self._offset = 0
-            self._populate()
-
     @log
     def _on_artist_activated(self, sidebar, row, data=None):
         """Initializes new artist album widgets"""
diff --git a/gnomemusic/views/baseview.py b/gnomemusic/views/baseview.py
index ed0935d9..05ed09f3 100644
--- a/gnomemusic/views/baseview.py
+++ b/gnomemusic/views/baseview.py
@@ -85,10 +85,6 @@ class BaseView(Gtk.Stack):
         if not self._init:
             self._on_grilo_ready()
 
-    @log
-    def _on_changes_pending(self, data=None):
-        pass
-
     @log
     def _setup_view(self):
         """Instantiate and set up the view object"""
diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py
index dcba02ce..4fa4d394 100644
--- a/gnomemusic/views/songsview.py
+++ b/gnomemusic/views/songsview.py
@@ -58,6 +58,9 @@ class SongsView(BaseView):
         self._offset = 0
         self._iter_to_clean = None
 
+
+        self.connect("notify::selection-mode", self._on_selection_mode_changed)
+
         self._view.get_style_context().add_class('songs-list-old')
 
         self._add_list_renderers()
@@ -152,25 +155,11 @@ class SongsView(BaseView):
         else:
             cell.props.visible = False
 
-    @log
-    def _on_changes_pending(self, data=None):
-        if (self._init
-                and not self.props.selection_mode):
-            self.model.clear()
-            self._offset = 0
-            self._populate()
-            # grilo.changes_pending['Songs'] = False
-
     @log
     def _on_selection_mode_changed(self, widget, data=None):
-        super()._on_selection_mode_changed(widget, data)
-
         cols = self._view.get_columns()
         cols[1].props.visible = self.props.selection_mode
 
-        if not self.props.selection_mode:
-            self._on_changes_pending()
-
     @log
     def _on_item_activated(self, treeview, path, column):
         """Action performed when clicking on a song


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