[gnome-music/wip/jfelder/tracker3: 8/9] trackerwrapper: Use the log object from the application




commit d87d113b7f200688dce1f53ce886b1f6c2c3e339
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Jul 29 00:54:26 2020 +0200

    trackerwrapper: Use the log object from the application

 gnomemusic/coregrilo.py      |  2 +-
 gnomemusic/trackerwrapper.py | 11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/gnomemusic/coregrilo.py b/gnomemusic/coregrilo.py
index d2b04f78..e3e9cf3d 100644
--- a/gnomemusic/coregrilo.py
+++ b/gnomemusic/coregrilo.py
@@ -69,7 +69,7 @@ class CoreGrilo(GObject.GObject):
         self._thumbnail_sources_timeout = None
         self._wrappers = {}
 
-        self._tracker_wrapper = TrackerWrapper()
+        self._tracker_wrapper = TrackerWrapper(application)
         self._tracker_wrapper.bind_property(
             "tracker-available", self, "tracker-available",
             GObject.BindingFlags.SYNC_CREATE)
diff --git a/gnomemusic/trackerwrapper.py b/gnomemusic/trackerwrapper.py
index c252039e..9bbb40a1 100644
--- a/gnomemusic/trackerwrapper.py
+++ b/gnomemusic/trackerwrapper.py
@@ -25,8 +25,6 @@ from enum import IntEnum
 
 from gi.repository import Gio, GLib, GObject, Tracker
 
-from gnomemusic.musiclogger import MusicLogger
-
 
 class TrackerState(IntEnum):
     """Tracker Status
@@ -37,12 +35,15 @@ class TrackerState(IntEnum):
 
 
 class TrackerWrapper(GObject.GObject):
-    """Create a connection to an instance of Tracker"""
 
-    def __init__(self):
+    def __init__(self, application):
+        """Create a connection to an instance of Tracker
+
+        :param Application application: The application object
+        """
         super().__init__()
 
-        self._log = MusicLogger()
+        self._log = application.props.log
 
         self._tracker = None
         self._tracker_available = TrackerState.UNAVAILABLE


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