[gnome-music/wip/mschraal/coremodel-flatten-search-models: 4/6] coremodel: Cleanup signal id handling




commit f0f599dcbd20b5c9eae81c2b79dd8b84a927ec23
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat Nov 14 10:46:56 2020 +0100

    coremodel: Cleanup signal id handling
    
    Use int exclusively: 0 is equal to no connection.

 gnomemusic/coremodel.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index 49d7adc64..b79d7bad9 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -85,7 +85,7 @@ class CoreModel(GObject.GObject):
         super().__init__()
 
         self._flatten_model = None
-        self._player_signal_id = None
+        self._player_signal_id = 0
         self._current_playlist_model = None
         self._previous_playlist_model = None
 
@@ -238,9 +238,9 @@ class CoreModel(GObject.GObject):
             if song.props.state in played_states:
                 song.props.state = SongWidget.State.UNPLAYED
 
-        if self._player_signal_id is not None:
+        if self._player_signal_id != 0:
             self._current_playlist_model.disconnect(self._player_signal_id)
-            self._player_signal_id = None
+            self._player_signal_id = 0
             self._current_playlist_model = None
 
         songs_added = []


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