[gnome-music/wip/mschraal/core: 135/177] coremodel: Fix songslist playlist generation
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/core: 135/177] coremodel: Fix songslist playlist generation
- Date: Wed, 3 Jul 2019 18:31:42 +0000 (UTC)
commit 81dab6324bc76a84b3d384309eb5569ed27500c0
Author: Marinus Schraal <mschraal gnome org>
Date: Fri Jun 28 20:45:43 2019 +0200
coremodel: Fix songslist playlist generation
Use the sorted model as base.
gnomemusic/coremodel.py | 2 +-
gnomemusic/songliststore.py | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index 0b717f51..634b626e 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -187,7 +187,7 @@ class CoreModel(GObject.GObject):
elif playlist_type == PlayerPlaylist.Type.SONGS:
self._playlist_model.remove_all()
- for song in self._model:
+ for song in self._songliststore.props.model:
self._playlist_model.append(song)
if song.props.state == SongWidget.State.PLAYING:
diff --git a/gnomemusic/songliststore.py b/gnomemusic/songliststore.py
index f8fdb4e7..b879ff50 100644
--- a/gnomemusic/songliststore.py
+++ b/gnomemusic/songliststore.py
@@ -1,4 +1,4 @@
-from gi.repository import Gfm, GObject, Gtk, GdkPixbuf
+from gi.repository import Gfm, Gio, GObject, Gtk, GdkPixbuf
from gi._gi import pygobject_new_full
@@ -66,3 +66,8 @@ class SongListStore(Gtk.ListStore):
position, [2, 3, 5, 9],
[coresong.props.title, coresong.props.artist, coresong,
int(coresong.props.favorite)])
+
+ @GObject.Property(
+ type=Gio.ListStore, default=None, flags=GObject.ParamFlags.READABLE)
+ def model(self):
+ return self._model
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]