[gnome-music/wip/mschraal/validation-status-fix-round-2: 2/2] coremodel: Avoid duplication
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/validation-status-fix-round-2: 2/2] coremodel: Avoid duplication
- Date: Thu, 18 Jul 2019 12:01:35 +0000 (UTC)
commit f359a7943095ee6977d0c3d6881c05c8a140da8b
Author: Marinus Schraal <mschraal gnome org>
Date: Thu Jul 18 13:59:37 2019 +0200
coremodel: Avoid duplication
gnomemusic/coremodel.py | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index 6ca192eb..b3722f34 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -235,10 +235,9 @@ class CoreModel(GObject.GObject):
| GObject.BindingFlags.SYNC_CREATE)
with model.freeze_notify():
+ self._playlist_model.remove_all()
if playlist_type == PlayerPlaylist.Type.ALBUM:
-
- self._playlist_model.remove_all()
proxy_model = Gio.ListStore.new(Gio.ListModel)
for disc in model:
@@ -264,7 +263,6 @@ class CoreModel(GObject.GObject):
self.emit("playlist-loaded")
elif playlist_type == PlayerPlaylist.Type.ARTIST:
- self._playlist_model.remove_all()
proxy_model = Gio.ListStore.new(Gio.ListModel)
for artist_album in model:
@@ -295,8 +293,6 @@ class CoreModel(GObject.GObject):
self._songliststore.props.model.disconnect(
self._song_signal_id)
- self._playlist_model.remove_all()
-
for song in self._songliststore.props.model:
self._playlist_model.append(song)
@@ -312,8 +308,6 @@ class CoreModel(GObject.GObject):
self._song_search_flatten.disconnect(
self._search_signal_id)
- self._playlist_model.remove_all()
-
for song in self._song_search_flatten:
self._playlist_model.append(song)
@@ -322,9 +316,6 @@ class CoreModel(GObject.GObject):
self.emit("playlist-loaded")
elif playlist_type == PlayerPlaylist.Type.PLAYLIST:
-
- self._playlist_model.remove_all()
-
for model_song in model:
song = CoreSong(
model_song.props.media, self._coreselection,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]