[gnome-music/wip/mschraal/assorted-cleanups: 12/32] artistartstack: Remove obsolete code



commit 113dd5b42f9bb7cf7e1a1bbc1000e51f180d6465
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Dec 24 17:55:51 2019 +0100

    artistartstack: Remove obsolete code
    
    This was copied from CoverStack when creating this code, but never got
    used.

 gnomemusic/widgets/artistartstack.py | 45 +-----------------------------------
 1 file changed, 1 insertion(+), 44 deletions(-)
---
diff --git a/gnomemusic/widgets/artistartstack.py b/gnomemusic/widgets/artistartstack.py
index 103a3596..b86d0ef8 100644
--- a/gnomemusic/widgets/artistartstack.py
+++ b/gnomemusic/widgets/artistartstack.py
@@ -22,7 +22,7 @@
 # code, but you are not obligated to do so.  If you do not wish to do so,
 # delete this exception statement from your version.
 
-from gi.repository import GLib, GObject, Gtk
+from gi.repository import GObject, Gtk
 
 from gnomemusic.albumartcache import Art
 from gnomemusic.artistart import ArtistCache, DefaultIcon
@@ -117,46 +117,3 @@ class ArtistArtStack(Gtk.Stack):
         else:
             self._cover_b.props.surface = surface
             self.props.visible_child_name = "B"
-
-    def update(self, coresong):
-        """Update the stack with the given CoreSong
-
-        Update the stack with the art retrieved from the given Coresong.
-        :param CoreSong coresong: The CoreSong object
-        """
-        if self._handler_id and self._art:
-            # Remove a possible dangling "finished" callback if update
-            # is called again, but it is still looking for the previous
-            # art.
-            self._art.disconnect(self._handler_id)
-            # Set the loading state only after a delay to make between
-            # song transitions smooth if loading time is negligible.
-            self._timeout = GLib.timeout_add(100, self._set_loading_child)
-
-        self._active_child = self.props.visible_child_name
-
-        self._art = Art(self.props.size, coresong, self.props.scale_factor)
-        self._handler_id = self._art.connect("finished", self._art_retrieved)
-        self._art.lookup()
-
-    def _set_loading_child(self):
-        self.props.visible_child_name = "loading"
-        self._active_child = self.props.visible_child_name
-        self._timeout = None
-
-        return GLib.SOURCE_REMOVE
-
-    def _art_retrieved(self, klass):
-        if self._timeout:
-            GLib.source_remove(self._timeout)
-            self._timeout = None
-
-        if self._active_child == "B":
-            self._cover_a.props.surface = klass.surface
-            self.props.visible_child_name = "A"
-        else:
-            self._cover_b.props.surface = klass.surface
-            self.props.visible_child_name = "B"
-
-        self._active_child = self.props.visible_child_name
-        self._art = None


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