[gnome-music/gbsneto/untangle-player-window-mpris: 8/9] player: Initialize PlayerPlaylist last



commit 45a5c6280c51c21a50c84df3a0f8c5e20f458155
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Apr 10 12:15:10 2019 -0300

    player: Initialize PlayerPlaylist last
    
    Another small (and apparently harmless) point noticed.
    PlayerPlayist uses GstPbutils assuming it is already
    initialized, which was never the case.
    
    Fix that by initializing PlayerPlaylist last in order.

 gnomemusic/player.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index b08b9757..ee80bd17 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -570,13 +570,6 @@ class Player(GObject.GObject):
     def __init__(self, application):
         super().__init__()
 
-        self._playlist = PlayerPlaylist()
-        self._playlist.connect('song-validated', self._on_song_validated)
-        self._playlist.bind_property(
-            'repeat-mode', self, 'repeat-mode',
-            GObject.BindingFlags.SYNC_CREATE
-            | GObject.BindingFlags.BIDIRECTIONAL)
-
         self._new_clock = True
 
         self._gst_player = GstPlayer(application)
@@ -592,6 +585,13 @@ class Player(GObject.GObject):
 
         self._lastfm = LastFmScrobbler()
 
+        self._playlist = PlayerPlaylist()
+        self._playlist.connect('song-validated', self._on_song_validated)
+        self._playlist.bind_property(
+            'repeat-mode', self, 'repeat-mode',
+            GObject.BindingFlags.SYNC_CREATE
+            | GObject.BindingFlags.BIDIRECTIONAL)
+
     @GObject.Property(
         type=bool, default=False, flags=GObject.ParamFlags.READABLE)
     def has_next(self):


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