[gnome-music/wip/mschraal/albumsview-selection-rework: 1/7] coredisc: Fixes




commit 1da1e1f82f9ce4365c532629ae8d5650c086749e
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Sep 10 12:23:16 2021 +0200

    coredisc: Fixes
    
    * Set the gtype name
    * Only update value if needed
    * Fix incorrect property flag

 gnomemusic/coredisc.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/coredisc.py b/gnomemusic/coredisc.py
index 697089a65..1643d357f 100644
--- a/gnomemusic/coredisc.py
+++ b/gnomemusic/coredisc.py
@@ -29,6 +29,8 @@ import gnomemusic.utils as utils
 
 class CoreDisc(GObject.GObject):
 
+    __gtype_name__ = "CoreDisc"
+
     disc_nr = GObject.Property(type=int, default=0)
     duration = GObject.Property(type=int, default=None)
     media = GObject.Property(type=Grl.Media, default=None)
@@ -109,12 +111,15 @@ class CoreDisc(GObject.GObject):
         self._coregrilo.populate_album_disc_songs(media, discnr, _callback)
 
     @GObject.Property(
-        type=bool, default=False, flags=GObject.BindingFlags.SYNC_CREATE)
+        type=bool, default=False, flags=GObject.ParamFlags.READWRITE)
     def selected(self):
         return self._selected
 
     @selected.setter  # type: ignore
     def selected(self, value):
+        if value == self._selected:
+            return
+
         self._selected = value
 
         # The model is loaded on-demand, so the first time the model is


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