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



commit ce0d6cd2d37f4ce97243969e3934f7bffbaadff0
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 | 17 +++++------------
 gnomemusic/grilowrappers/grltrackerwrapper.py   |  2 +-
 2 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerplaylists.py b/gnomemusic/grilowrappers/grltrackerplaylists.py
index d4b57577..bda68e0f 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, songs_hash):
+    def __init__(self, source, application, tracker_wrapper, songs_hash):
         """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
@@ -69,7 +66,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
@@ -146,10 +143,8 @@ class GrlTrackerPlaylists(GObject.GObject):
             return
 
         playlist = Playlist(
-            media=media, source=self._source, coremodel=self._coremodel,
-            application=self._application,
+            media=media, application=self._application,
             tracker_wrapper=self._tracker_wrapper, songs_hash=self._songs_hash)
-
         self._model.append(playlist)
         callback = data
         if callback is not None:
@@ -304,8 +299,7 @@ class Playlist(GObject.GObject):
 
     def __init__(
             self, media=None, query=None, tag_text=None, source=None,
-            coremodel=None, application=None, tracker_wrapper=None,
-            songs_hash=None):
+            application=None, tracker_wrapper=None, songs_hash=None):
         super().__init__()
         """Initialize a playlist
 
@@ -314,7 +308,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
        :param dict songs_hash: The songs hash table
@@ -332,7 +325,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._songs_hash = songs_hash
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index b6d599bd..285c4aa4 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -385,7 +385,7 @@ class GrlTrackerWrapper(GObject.GObject):
                 # songs model fill, the playlists expect a filled songs
                 # hashtable.
                 self._tracker_playlists = GrlTrackerPlaylists(
-                    self.props.source, self._coremodel, self._application,
+                    self.props.source, self._application,
                     self._tracker_wrapper, self._hash)
 
                 return


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