[gnome-music/wip/mschraal/validation-status-fix-round-2: 66/66] coremodel: Avoid duplication
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/validation-status-fix-round-2: 66/66] coremodel: Avoid duplication
- Date: Mon, 5 Aug 2019 22:22:35 +0000 (UTC)
commit 5755100a6409f441ca405e3dd14661e9c89714bc
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 70257a3b..5138b07d 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -245,10 +245,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:
@@ -274,7 +273,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:
@@ -305,8 +303,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)
@@ -322,8 +318,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)
@@ -332,9 +326,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]