[gnome-music/wip/mschraal/baseview-cleanup: 3/8] baseview: Remove all _populate calls



commit c7e1008cb89b8fd05a966ba507a2c7ba98a49bcf
Author: Marinus Schraal <mschraal gnome org>
Date:   Wed Jul 17 16:59:41 2019 +0200

    baseview: Remove all _populate calls

 gnomemusic/views/albumsview.py    | 6 ------
 gnomemusic/views/artistsview.py   | 5 -----
 gnomemusic/views/baseview.py      | 8 ++------
 gnomemusic/views/playlistsview.py | 7 -------
 gnomemusic/views/searchview.py    | 5 -----
 gnomemusic/views/songsview.py     | 5 -----
 6 files changed, 2 insertions(+), 34 deletions(-)
---
diff --git a/gnomemusic/views/albumsview.py b/gnomemusic/views/albumsview.py
index e7feb0fd..e07b95ff 100644
--- a/gnomemusic/views/albumsview.py
+++ b/gnomemusic/views/albumsview.py
@@ -133,12 +133,6 @@ class AlbumsView(BaseView):
         self._headerbar.props.title = corealbum.props.title
         self._headerbar.props.subtitle = corealbum.props.artist
 
-    @log
-    def _populate(self, data=None):
-        # self._window.notifications_popup.push_loading()
-        self._init = True
-        self._view.show()
-
     def _toggle_all_selection(self, selected):
         """
         Selects or unselects all items without sending the notify::active
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index 446ac6aa..fcb3849a 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -164,11 +164,6 @@ class ArtistsView(BaseView):
 
         self._loaded_artists.append(coreartist.props.artist)
 
-    @log
-    def _populate(self, data=None):
-        """Populates the view"""
-        pass
-
     @log
     def _on_sidebar_clicked(self, gesture, n_press, x, y):
         success, state = Gtk.get_current_event_state()
diff --git a/gnomemusic/views/baseview.py b/gnomemusic/views/baseview.py
index ce0583a0..3431b593 100644
--- a/gnomemusic/views/baseview.py
+++ b/gnomemusic/views/baseview.py
@@ -92,7 +92,7 @@ class BaseView(Gtk.Stack):
     def _on_grilo_ready(self, data=None):
         if (self._headerbar.props.stack.props.visible_child == self
                 and not self._init):
-            self._populate()
+            pass
 
         self._headerbar.props.stack.connect(
             'notify::visible-child', self._on_headerbar_visible)
@@ -101,11 +101,7 @@ class BaseView(Gtk.Stack):
     def _on_headerbar_visible(self, widget, param):
         if (self == widget.get_visible_child()
                 and not self._init):
-            self._populate()
-
-    @log
-    def _populate(self, data=None):
-        pass
+            pass
 
     @log
     def _on_selection_mode_changed(self, widget, data=None):
diff --git a/gnomemusic/views/playlistsview.py b/gnomemusic/views/playlistsview.py
index 72a6d6aa..f738f5f4 100644
--- a/gnomemusic/views/playlistsview.py
+++ b/gnomemusic/views/playlistsview.py
@@ -326,10 +326,3 @@ class PlaylistsView(BaseView):
         selection = self._sidebar.get_selected_row()
         current_playlist = selection.props.playlist
         current_playlist.reorder(source_position, target_position)
-
-    @log
-    def _populate(self, data=None):
-        """Populate sidebar.
-        Do not reload playlists already displayed.
-        """
-        self._init = True
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index 497364db..e794de48 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -310,8 +310,3 @@ class SearchView(BaseView):
         if (not self._search_mode_active
                 and self.get_visible_child() == self._grid):
             self.props.search_state = Search.State.NONE
-
-    @log
-    def _populate(self, data=None):
-        self._init = True
-        self._headerbar.props.state = HeaderBar.State.MAIN
diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py
index 3012761b..dfe73d8b 100644
--- a/gnomemusic/views/songsview.py
+++ b/gnomemusic/views/songsview.py
@@ -230,11 +230,6 @@ class SongsView(BaseView):
 
         return False
 
-    @log
-    def _populate(self, data=None):
-        """Populates the view"""
-        self._init = True
-
     def _select(self, value):
         with self._model.freeze_notify():
             itr = self._model.iter_children(None)


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