[gnome-music/wip/mschraal/core: 107/190] artistalbumswidget: Cleanup unused stuff



commit a32e8a803de2349e867c09b8e687bbfd6cac0eca
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Jun 23 22:58:36 2019 +0200

    artistalbumswidget: Cleanup unused stuff

 gnomemusic/widgets/artistalbumswidget.py | 73 +-------------------------------
 1 file changed, 1 insertion(+), 72 deletions(-)
---
diff --git a/gnomemusic/widgets/artistalbumswidget.py b/gnomemusic/widgets/artistalbumswidget.py
index 761ecad5..8bd8ecb6 100644
--- a/gnomemusic/widgets/artistalbumswidget.py
+++ b/gnomemusic/widgets/artistalbumswidget.py
@@ -68,10 +68,6 @@ class ArtistAlbumsWidget(Gtk.Box):
 
         self._widgets = []
 
-        # self._create_model()
-
-        # self._model.connect('row-changed', self._model_row_changed)
-
         hbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
         self._album_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL,
                                   spacing=48)
@@ -88,13 +84,10 @@ class ArtistAlbumsWidget(Gtk.Box):
         self._songs_grid_size_group = Gtk.SizeGroup.new(
             Gtk.SizeGroupMode.HORIZONTAL)
 
-        self._window.notifications_popup.push_loading()
-
-        # self._albums_to_load = len(albums)
+        # FIXME: Make this a ListBox as well.
         for album in self._model:
             self._add_album(album)
 
-        # self._player.connect('song-changed', self._update_model)
         self.show_all()
 
     def _song_activated(self, widget, song_widget):
@@ -112,25 +105,6 @@ class ArtistAlbumsWidget(Gtk.Box):
             PlayerPlaylist.Type.ARTIST, self._album, song_widget._media,
             self._model)
 
-    @log
-    def _create_model(self):
-        """Create the ListStore model for this widget."""
-        self._model = Gtk.ListStore(
-            GObject.TYPE_STRING,  # title
-            GObject.TYPE_STRING,
-            GObject.TYPE_STRING,
-            GObject.TYPE_STRING,
-            GObject.TYPE_STRING,    # placeholder
-            GObject.TYPE_OBJECT,  # song object
-            GObject.TYPE_BOOLEAN,  # item selected
-            GObject.TYPE_STRING,
-            GObject.TYPE_BOOLEAN,
-            GObject.TYPE_INT,  # icon shown
-            GObject.TYPE_BOOLEAN,
-            GObject.TYPE_INT
-        )
-
-    @log
     def _add_album(self, corealbum):
         widget = ArtistAlbumWidget(
             corealbum, self._selection_mode_allowed,
@@ -146,51 +120,6 @@ class ArtistAlbumsWidget(Gtk.Box):
 
         widget.connect("song-activated", self._song_activated)
 
-    @log
-    def _update_model(self, player):
-        """Updates model when the song changes
-
-        :param Player player: The main player object
-        """
-        if not player.playing_playlist(
-                PlayerPlaylist.Type.ARTIST, self._artist):
-            self._clean_model()
-            return False
-
-        current_song = player.props.current_song
-        song_passed = False
-        itr = self._model.get_iter_first()
-
-        while itr:
-            song = self._model[itr][5]
-            song_widget = song.song_widget
-
-            if (song.get_id() == current_song.get_id()):
-                song_widget.props.state = SongWidget.State.PLAYING
-                song_passed = True
-            elif (song_passed):
-                # Counter intuitive, but this is due to call order.
-                song_widget.props.state = SongWidget.State.UNPLAYED
-            else:
-                song_widget.props.state = SongWidget.State.PLAYED
-
-            itr = self._model.iter_next(itr)
-
-        return False
-
-    @log
-    def _clean_model(self):
-        itr = self._model.get_iter_first()
-
-        while itr:
-            song = self._model[itr][5]
-            song_widget = song.song_widget
-            song_widget.props.state = SongWidget.State.UNPLAYED
-
-            itr = self._model.iter_next(itr)
-
-        return False
-
     @log
     def _model_row_changed(self, model, path, itr):
         if not self.props.selection_mode:


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