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



commit cf34c54a92e3277b2dd65cbd09378f14120877a2
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 e5372662..27352030 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -86,8 +86,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()
@@ -141,7 +141,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
@@ -365,7 +366,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]