[gnome-music/wip/jfelder/grilo-misc-cleanups: 6/9] grilo: Define tracker_plugin_available property



commit 0902cbc118338a2f138e5d64d87de928694c1cca
Author: Jean Felder <jfelder src gnome org>
Date:   Thu May 2 11:53:45 2019 +0200

    grilo: Define tracker_plugin_available property
    
    The views should not directly interact with the tracker plugin.

 gnomemusic/grilo.py          | 5 +++++
 gnomemusic/views/baseview.py | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index e42fe4cc..7e91669c 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -498,5 +498,10 @@ class Grilo(GObject.GObject):
         # queryable supported Grilo source.
         self._tracker_wrapper.local_songs_available(callback)
 
+    @GObject.Property(
+        type=bool, default=False, flags=GObject.ParamFlags.READABLE)
+    def tracker_plugin_available(self):
+        return self.tracker is not None
+
 
 grilo = Grilo()
diff --git a/gnomemusic/views/baseview.py b/gnomemusic/views/baseview.py
index c1794c9b..b821b422 100644
--- a/gnomemusic/views/baseview.py
+++ b/gnomemusic/views/baseview.py
@@ -98,7 +98,7 @@ class BaseView(Gtk.Stack):
             'selection-mode', self._window, 'selection-mode',
             GObject.BindingFlags.BIDIRECTIONAL)
 
-        if (grilo.tracker is not None
+        if (grilo.props.tracker_plugin_available
                 and not self._init):
             self._on_grilo_ready()
 


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