[gnome-music/wip/mschraal/308-empty-artistsview: 3/3] window: Fix emptyview logic



commit 0f2aa54c20231a7baded26d4d244351ff25fb7a6
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Aug 22 01:01:42 2019 +0200

    window: Fix emptyview logic
    
    If Tracker was available, but no songs were indexed Music would show the
    incorrect Tracker not available EmptyView.
    
    On Tracker becoming available, check if there are any songs to show.
    
    Fixes #308

 gnomemusic/coregrilo.py | 1 -
 gnomemusic/window.py    | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/coregrilo.py b/gnomemusic/coregrilo.py
index 940fc9fc..d047f87f 100644
--- a/gnomemusic/coregrilo.py
+++ b/gnomemusic/coregrilo.py
@@ -124,7 +124,6 @@ class CoreGrilo(GObject.GObject):
             new_wrapper = GrlTrackerWrapper(
                 source, self._coremodel, self._coreselection, self)
             self._wrappers[source.props.source_id] = new_wrapper
-            self.props.tracker_available = True
         # elif source.props.source_id[:10] == "grl-dleyna":
         #     new_wrapper = GrlDLeynaWrapper(
         #         source, self._coremodel, self._coreselection, self)
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 3d027f3e..602bf3e0 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -242,6 +242,8 @@ class Window(Gtk.ApplicationWindow):
         if new_state != TrackerState.AVAILABLE:
             self._switch_to_empty_view()
 
+        self._on_songs_available(None, None)
+
     @log
     def _switch_to_player_view(self):
         self._settings.set_boolean('did-initial-state', True)


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