[gnome-music/wip/mschraal/gtk4-pre-squash-backup: 253/254] coremodel: Sort songs incrementally
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/gtk4-pre-squash-backup: 253/254] coremodel: Sort songs incrementally
- Date: Thu, 17 Feb 2022 11:35:48 +0000 (UTC)
commit c5b114cb29e973613e673c167d32b110d97f5199
Author: Marinus Schraal <mschraal gnome org>
Date: Tue Feb 15 12:10:11 2022 +0100
coremodel: Sort songs incrementally
Incremental sort should be a smoother experience.
Add ordering to the Tracker query to help the sorter.
gnomemusic/coremodel.py | 1 +
gnomemusic/grilowrappers/grltrackerwrapper.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index e8720be26..97a930405 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -97,6 +97,7 @@ class CoreModel(GObject.GObject):
self._songs_model = Gtk.SortListModel.new(self._flatten_songs_model)
sorter = Gtk.CustomSorter()
sorter.set_sort_func(self._songs_sort)
+ self._songs_model.props.incremental = True
self._songs_model.set_sorter(sorter)
self._albums_model_proxy: Gio.ListStore = Gio.ListStore.new(
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 959ed472c..680ba409f 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -457,7 +457,7 @@ class GrlTrackerWrapper(GObject.GObject):
?urn nao:hasTag ?tag .
FILTER (?tag = nao:predefined-tag-favorite)
}}
- }}
+ }} ORDER BY ?title ?artist
""".split())
return query
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]