[gnome-music] view: properly refresh playlist



commit 91dcfb39203e67ac9edc8e8c3981cb39b11aa493
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Wed Aug 5 11:41:09 2015 +0200

    view: properly refresh playlist

 gnomemusic/view.py |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index b37175b..4eecd51 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -1135,24 +1135,11 @@ class Playlist(ViewContainer):
 
         # if the active queue has been set by this playlist,
         # use it as model, otherwise build the liststore
-        self.model = Gtk.ListStore(
-            GObject.TYPE_STRING,
-            GObject.TYPE_STRING,
-            GObject.TYPE_STRING,
-            GObject.TYPE_STRING,
-            GdkPixbuf.Pixbuf,
-            GObject.TYPE_OBJECT,
-            GObject.TYPE_BOOLEAN,
-            GObject.TYPE_INT,
-            GObject.TYPE_STRING,
-            GObject.TYPE_BOOLEAN,
-            GObject.TYPE_BOOLEAN,
-            GObject.TYPE_INT
-        )
-        self.view.set_model(self.model)
+        self.model = self.view.get_model()
+        self.model.clear()
         GLib.idle_add(grilo.populate_playlist_songs, playlist, self._add_item)
         self.songs_count = 0
-        self._update_songs_count()
+        GLib.idle_add(self._update_songs_count)
 
         # disable delete button if current playlist is a smart playlist
         if self.current_playlist_is_protected():



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