[gnome-music/wip/mschraal/coresong-thumbnail-prop: 17/35] grltrackerplaylist: Drop coremodel argument



commit f3389cd6456b44fc3e5bb7ff92bf2f89ce9f6858
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Dec 24 11:02:45 2019 +0100

    grltrackerplaylist: Drop coremodel argument
    
    CoreModel is provided through Application.

 gnomemusic/grilowrappers/grltrackerplaylists.py | 16 ++++++----------
 gnomemusic/grilowrappers/grltrackerwrapper.py   |  2 +-
 2 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index 9a717eaa..98d0409a 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -58,13 +58,10 @@ class GrlTrackerPlaylists(GObject.GObject):
     def __repr__(self):
         return "<GrlTrackerPlaylists>"
 
-    def __init__(
-            self, source, coremodel, application, tracker_wrapper):
+    def __init__(self, source, application, tracker_wrapper):
         """Initialize GrlTrackerPlaylists.
 
         :param Grl.TrackerSource source: The Tracker source to wrap
-        :param CoreModel coremodel: CoreModel instance to use models
-                                    from
         :param Application application: Application instance
         :param TrackerWrapper tracker_wrapper: The TrackerWrapper
                                                instance
@@ -72,7 +69,7 @@ class GrlTrackerPlaylists(GObject.GObject):
         super().__init__()
 
         self._application = application
-        self._coremodel = coremodel
+        self._coremodel = application.props.coremodel
         self._source = source
         self._model = self._coremodel.props.playlists
         self._model_filter = self._coremodel.props.playlists_filter
@@ -146,8 +143,8 @@ class GrlTrackerPlaylists(GObject.GObject):
             return
 
         playlist = Playlist(
-            media=media, source=self._source, coremodel=self._coremodel,
-            application=self._application, tracker=self._tracker)
+            media=media, source=self._source, application=self._application,
+            tracker=self._tracker)
 
         self._model.append(playlist)
         callback = data
@@ -294,7 +291,7 @@ class Playlist(GObject.GObject):
 
     def __init__(
             self, media=None, query=None, tag_text=None, source=None,
-            coremodel=None, application=None, tracker=None):
+            application=None, tracker=None):
 
         super().__init__()
         """Initialize a playlist
@@ -304,7 +301,6 @@ class Playlist(GObject.GObject):
        :param string tag_text: The non translatable unique identifier
             of the playlist
        :param Grl.Source source: The Grilo Tracker source object
-       :param CoreModel coremodel: The CoreModel instance
        :param Application application: The Application instance
        :param TrackerWrapper tracker: The TrackerWrapper instance
         """
@@ -319,7 +315,7 @@ class Playlist(GObject.GObject):
         self._application = application
         self._model = None
         self._source = source
-        self._coremodel = coremodel
+        self._coremodel = application.props.coremodel
         self._tracker = tracker
         self._window = application.props.window
 
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 34ccb08c..b7be413e 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -107,7 +107,7 @@ class GrlTrackerWrapper(GObject.GObject):
         self._initial_artists_fill(self._source)
 
         self._tracker_playlists = GrlTrackerPlaylists(
-            source, coremodel, application, tracker_wrapper)
+            source, application, tracker_wrapper)
 
         self._source.notify_change_start()
         self._source.connect("content-changed", self._batch_content_changed)


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