[gnome-music/wip/jfelder/selection-coresong-playlist: 4/4] grltrackerplaylists: Make state property binding unidirectional



commit 5fda871452e52288f87b85d6e2cff056fbfb8ed1
Author: Jean Felder <jfelder src gnome org>
Date:   Sat Mar 28 10:41:14 2020 +0100

    grltrackerplaylists: Make state property binding unidirectional
    
    There is no need to be bidirectional. That way, another view will show
    the correct song playing.

 gnomemusic/grilowrappers/grltrackerplaylists.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index c7a5a931..3c32172e 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -435,17 +435,20 @@ class Playlist(GObject.GObject):
         # It is not necessary to bind all the CoreSong properties:
         # selected property is linked to a view
         # validation is a short-lived playability check for local songs
-        properties = [
+        bidirectional_properties = [
             "album", "album_disc_number", "artist", "duration", "media",
-            "grlid", "play_count", "state", "title", "track_number", "url",
-            "favorite"]
+            "grlid", "play_count", "title", "track_number", "url", "favorite"]
 
-        for prop in properties:
+        for prop in bidirectional_properties:
             main_coresong.bind_property(
                 prop, coresong, prop,
                 GObject.BindingFlags.BIDIRECTIONAL
                 | GObject.BindingFlags.SYNC_CREATE)
 
+        # There is no need for the "state" property to be bidirectional
+        coresong.bind_property(
+            prop, main_coresong, "state", GObject.BindingFlags.DEFAULT)
+
     @GObject.Property(type=str, default=None)
     def title(self):
         """Playlist title


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