[gnome-music] window: Make sure to populate views



commit 17d7772763ecde70ddaf8dcec8ef64a75efb79aa
Author: Marinus Schraal <mschraal src gnome org>
Date:   Sun Nov 20 18:48:07 2016 +0100

    window: Make sure to populate views
    
    With the async changes the emit signal is triggered too early it seems
    and the views aren't populated. Instead populate them like the albums
    view.

 gnomemusic/views/baseview.py |    2 ++
 gnomemusic/window.py         |    3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/views/baseview.py b/gnomemusic/views/baseview.py
index f6ce21e..ad26c1a 100644
--- a/gnomemusic/views/baseview.py
+++ b/gnomemusic/views/baseview.py
@@ -162,6 +162,8 @@ class BaseView(Gtk.Stack):
 
     @log
     def _on_grilo_ready(self, data=None):
+        # FIXME: with async changes in Window this seems never to be
+        # called anymore. Fix it proper or remove.
         if (self.header_bar.get_stack().get_visible_child() == self and not self._init):
             self._populate()
         self.header_bar.get_stack().connect('notify::visible-child',
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 9f5631d..abf0d50 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -297,7 +297,8 @@ class Window(Gtk.ApplicationWindow):
         self.toolbar.searchbar.show()
         self.toolbar.dropdown.show()
 
-        self.views[0].populate()
+        for i in self.views:
+            GLib.idle_add(i.populate)
 
     @log
     def _on_select_all(self, action, param):


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