[gnome-music/wip/mschraal/drop-dzl-listmodelfilter] Use Gtk.FilterListModel exclusively



commit 2ca08ed22ade00c2f3acdfa923814df3fcf0aafe
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Aug 15 17:42:11 2019 +0200

    Use Gtk.FilterListModel exclusively
    
    When starting the core rewrite Dazzle.FilterListModel was used at times.
    Replace Dazzle usage with Gtk.FilterListModel instead.

 gnomemusic/coredisc.py                        |  4 ++--
 gnomemusic/coremodel.py                       | 18 +++++++++---------
 gnomemusic/grilowrappers/grltrackerwrapper.py |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gnomemusic/coredisc.py b/gnomemusic/coredisc.py
index bfba600f..ea4939ad 100644
--- a/gnomemusic/coredisc.py
+++ b/gnomemusic/coredisc.py
@@ -22,7 +22,7 @@
 # code, but you are not obligated to do so.  If you do not wish to do so,
 # delete this exception statement from your version.
 
-from gi.repository import Dazzle, GObject, Gio, Gfm, Grl
+from gi.repository import GObject, Gio, Gfm, Grl
 from gi._gi import pygobject_new_full
 
 
@@ -50,7 +50,7 @@ class CoreDisc(GObject.GObject):
     @GObject.Property(type=Gio.ListModel, default=None)
     def model(self):
         if self._model is None:
-            self._filter_model = Dazzle.ListModelFilter.new(
+            self._filter_model = Gfm.FilterListModel.new(
                 self._coremodel.props.songs)
             self._filter_model.set_filter_func(lambda a: False)
             self._model = Gfm.SortListModel.new(self._filter_model)
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index 5138b07d..2b03f165 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -25,8 +25,8 @@
 import math
 
 import gi
-gi.require_versions({'Dazzle': '1.0', 'Gfm': '0.1'})
-from gi.repository import Dazzle, GObject, Gio, Gfm, Gtk
+gi.require_versions({'Gfm': '0.1'})
+from gi.repository import GObject, Gio, Gfm, Gtk
 from gi._gi import pygobject_new_full
 
 from gnomemusic.coreartist import CoreArtist
@@ -104,14 +104,14 @@ class CoreModel(GObject.GObject):
         self._song_search_flatten = Gfm.FlattenListModel.new(CoreSong)
         self._song_search_flatten.set_model(self._song_search_proxy)
 
-        self._album_search_model = Dazzle.ListModelFilter.new(
+        self._album_search_model = Gfm.FilterListModel.new(
             self._album_model)
         self._album_search_model.set_filter_func(lambda a: False)
 
         self._album_search_filter = Gfm.FilterListModel.new(
             self._album_search_model)
 
-        self._artist_search_model = Dazzle.ListModelFilter.new(
+        self._artist_search_model = Gfm.FilterListModel.new(
             self._artist_model)
         self._artist_search_model.set_filter_func(lambda a: False)
 
@@ -119,7 +119,7 @@ class CoreModel(GObject.GObject):
             self._artist_search_model)
 
         self._playlists_model = Gio.ListStore.new(Playlist)
-        self._playlists_model_filter = Dazzle.ListModelFilter.new(
+        self._playlists_model_filter = Gfm.FilterListModel.new(
             self._playlists_model)
         self._playlists_model_sort = Gfm.SortListModel.new(
             self._playlists_model_filter)
@@ -198,7 +198,7 @@ class CoreModel(GObject.GObject):
         return disc_model_sort
 
     def get_artist_album_model(self, media):
-        albums_model_filter = Dazzle.ListModelFilter.new(self._album_model)
+        albums_model_filter = Gfm.FilterListModel.new(self._album_model)
         albums_model_filter.set_filter_func(lambda a: False)
 
         albums_model_sort = Gfm.SortListModel.new(albums_model_filter)
@@ -420,7 +420,7 @@ class CoreModel(GObject.GObject):
         return self._playlist_model_sort
 
     @GObject.Property(
-        type=Dazzle.ListModelFilter, default=None,
+        type=Gfm.FilterListModel, default=None,
         flags=GObject.ParamFlags.READABLE)
     def songs_search(self):
         return self._song_search_flatten
@@ -432,7 +432,7 @@ class CoreModel(GObject.GObject):
         return self._song_search_proxy
 
     @GObject.Property(
-        type=Dazzle.ListModelFilter, default=None,
+        type=Gfm.FilterListModel, default=None,
         flags=GObject.ParamFlags.READABLE)
     def albums_search(self):
         return self._album_search_model
@@ -444,7 +444,7 @@ class CoreModel(GObject.GObject):
         return self._album_search_filter
 
     @GObject.Property(
-        type=Dazzle.ListModelFilter, default=None,
+        type=Gfm.FilterListModel, default=None,
         flags=GObject.ParamFlags.READABLE)
     def artists_search(self):
         return self._artist_search_model
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 97953c81..0852e98a 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -479,7 +479,7 @@ class GrlTrackerWrapper(GObject.GObject):
         """Get all albums by an artist
 
         :param Grl.Media media: The media with the artist id
-        :param Dazzle.ListModelFilter model: The model to fill
+        :param Gfm.FilterListModel model: The model to fill
         """
         artist_id = media.get_id()
 


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