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



commit f807ecaba1f9f1b6fec4b734177b1c13219b6dcc
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 | 15 +++++----------
 gnomemusic/grilowrappers/grltrackerwrapper.py   |  2 +-
 2 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index aa0a304a..713d65dd 100644
--- a/gnomemusic/grilowrappers/grltrackerplaylists.py
+++ b/gnomemusic/grilowrappers/grltrackerplaylists.py
@@ -54,13 +54,10 @@ class GrlTrackerPlaylists(GObject.GObject):
         Grl.METADATA_KEY_URL
     ]
 
-    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
@@ -68,7 +65,7 @@ class GrlTrackerPlaylists(GObject.GObject):
         super().__init__()
 
         self._application = application
-        self._coremodel = coremodel
+        self._coremodel = application.props.coremodel
         self._log = application.props.log
         self._source = source
         self._model = self._coremodel.props.playlists
@@ -143,8 +140,7 @@ class GrlTrackerPlaylists(GObject.GObject):
             return
 
         playlist = Playlist(
-            media=media, source=self._source, coremodel=self._coremodel,
-            application=self._application,
+            media=media, source=self._source, application=self._application,
             tracker_wrapper=self._tracker_wrapper)
 
         self._model.append(playlist)
@@ -287,7 +283,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_wrapper=None):
 
         super().__init__()
         """Initialize a playlist
@@ -297,7 +293,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_wrapper: The TrackerWrapper instance
         """
@@ -314,7 +309,7 @@ class Playlist(GObject.GObject):
         self._application = application
         self._model = None
         self._source = source
-        self._coremodel = coremodel
+        self._coremodel = application.props.coremodel
         self._coreselection = application.props.coreselection
         self._log = application.props.log
         self._tracker = tracker_wrapper.props.tracker
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 8ae3e349..d5b9e286 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -108,7 +108,7 @@ class GrlTrackerWrapper(GObject.GObject):
         self._initial_artists_fill(self.props.source)
 
         self._tracker_playlists = GrlTrackerPlaylists(
-            source, coremodel, application, tracker_wrapper)
+            source, application, tracker_wrapper)
 
     @GObject.Property(type=Grl.Source, default=None)
     def source(self):


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