[gnome-music/wip/mschraal/core: 113/118] coremodel: Stop passing around _hash



commit ced6d0658de1ea07ae04123f46fc162e42baa42c
Author: Marinus Schraal <mschraal gnome org>
Date:   Mon Jun 24 01:56:28 2019 +0200

    coremodel: Stop passing around _hash
    
    It is only used inside GrlTrackerSource.

 gnomemusic/coregrilo.py                      | 7 +++----
 gnomemusic/coremodel.py                      | 5 ++---
 gnomemusic/grilowrappers/grldleynasource.py  | 3 +--
 gnomemusic/grilowrappers/grltrackersource.py | 4 ++--
 4 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/gnomemusic/coregrilo.py b/gnomemusic/coregrilo.py
index c6205843..55134644 100644
--- a/gnomemusic/coregrilo.py
+++ b/gnomemusic/coregrilo.py
@@ -12,7 +12,7 @@ class CoreGrilo(GObject.GObject):
         return "<CoreGrilo>"
 
     def __init__(
-            self, coremodel, model, _hash, albums_model, artists_model,
+            self, coremodel, model, albums_model, artists_model,
             coreselection):
         super().__init__()
 
@@ -21,7 +21,6 @@ class CoreGrilo(GObject.GObject):
         self._model = model
         self._albums_model = albums_model
         self._artists_model = artists_model
-        self._hash = _hash
 
         Grl.init(None)
 
@@ -33,12 +32,12 @@ class CoreGrilo(GObject.GObject):
         print("SOURCE", source.props.source_id[:10])
         if source.props.source_id == "grl-tracker-source":
             self._tracker_source = GrlTrackerSource(
-                source, self._hash, self._model, self._albums_model,
+                source, self._model, self._albums_model,
                 self._artists_model, self._coremodel, self._coreselection)
             print(self._tracker_source, "added")
         elif source.props.source_id[:10] == "grl-dleyna":
             self._dleyna_source = GrlDLeynaSource(
-                source, self._hash, self._model, self._albums_model,
+                source, self._model, self._albums_model,
                 self._artists_model, self._coremodel, self._coreselection)
             print(self._dleyna_source, "added")
 
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index 344fd97d..a1ae199f 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -59,12 +59,11 @@ class CoreModel(GObject.GObject):
         self._selection_model.set_filter_func(self._filter_selected)
 
         self._album_store = None
-        self._hash = {}
 
         print("PLAYLIST_MODEL", self._playlist_model)
         self._grilo = CoreGrilo(
-            self, self._model, self._hash, self._album_model,
-            self._artist_model, self._coreselection)
+            self, self._model, self._album_model, self._artist_model,
+            self._coreselection)
 
         self._selection_model.connect("items-changed", self._on_sel_changed)
 
diff --git a/gnomemusic/grilowrappers/grldleynasource.py b/gnomemusic/grilowrappers/grldleynasource.py
index aa911780..54917557 100644
--- a/gnomemusic/grilowrappers/grldleynasource.py
+++ b/gnomemusic/grilowrappers/grldleynasource.py
@@ -31,7 +31,7 @@ class GrlDLeynaSource(GObject.GObject):
         return "<GrlDLeynaSource>"
 
     def __init__(
-            self, source, _hash, model, albums_model, artists_model, coremodel,
+            self, source, model, albums_model, artists_model, coremodel,
             core_selection):
         super().__init__()
 
@@ -42,7 +42,6 @@ class GrlDLeynaSource(GObject.GObject):
         self._albums_model = albums_model
         self._album_ids = {}
         self._artists_model = artists_model
-        self._hash = _hash
 
         Grl.init(None)
 
diff --git a/gnomemusic/grilowrappers/grltrackersource.py b/gnomemusic/grilowrappers/grltrackersource.py
index 4d29e55a..164a0937 100644
--- a/gnomemusic/grilowrappers/grltrackersource.py
+++ b/gnomemusic/grilowrappers/grltrackersource.py
@@ -31,7 +31,7 @@ class GrlTrackerSource(GObject.GObject):
         return "<GrlTrackerSource>"
 
     def __init__(
-            self, source, _hash, model, albums_model, artists_model, coremodel,
+            self, source, model, albums_model, artists_model, coremodel,
             core_selection):
         super().__init__()
 
@@ -42,7 +42,7 @@ class GrlTrackerSource(GObject.GObject):
         self._albums_model = albums_model
         self._album_ids = {}
         self._artists_model = artists_model
-        self._hash = _hash
+        self._hash = {}
 
         Grl.init(None)
 


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