[gnome-music/wip/jfelder/coremodel-songs-model-rename: 1/2] coremodel: Rename _model to _songs_model



commit 9b810adf5210f6a9418c5a4e090dec5b1cd95da1
Author: Jean Felder <jfelder src gnome org>
Date:   Sun Mar 1 20:12:32 2020 +0100

    coremodel: Rename _model to _songs_model
    
    CoreModel deals with a lot of model and "_model" is a generic
    name. When reading the code, it is not easy to understand that this
    model represents all the songs.
    
    Rename it to "_songs_model" in order to avoid any confusion.

 gnomemusic/coremodel.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index 4e76c346..3bfdf0a6 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -87,8 +87,8 @@ class CoreModel(GObject.GObject):
         self._current_playlist_model = None
         self._previous_playlist_model = None
 
-        self._model = Gio.ListStore.new(CoreSong)
-        self._songliststore = SongListStore(self._model)
+        self._songs_model = Gio.ListStore.new(CoreSong)
+        self._songliststore = SongListStore(self._songs_model)
 
         self._coreselection = application.props.coreselection
         self._album_model = Gio.ListStore()
@@ -142,7 +142,8 @@ class CoreModel(GObject.GObject):
         # fixed.
         self._grilo = self.props.grilo
 
-        self._model.connect("items-changed", self._on_songs_items_changed)
+        self._songs_model.connect(
+            "items-changed", self._on_songs_items_changed)
 
     def _on_songs_items_changed(self, model, position, removed, added):
         available = self.props.songs_available
@@ -400,7 +401,7 @@ class CoreModel(GObject.GObject):
     @GObject.Property(
         type=Gio.ListStore, default=None, flags=GObject.ParamFlags.READABLE)
     def songs(self):
-        return self._model
+        return self._songs_model
 
     @GObject.Property(
         type=Gio.ListStore, default=None, flags=GObject.ParamFlags.READABLE)


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