[tracker/wip/carlosg/circular-dep-hack] libtracker-sparql: Use more hackish ways to check for local bus notifications



commit 3f9459472de94a06bb3e90374b839acfb65d0a3b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jun 25 12:39:51 2020 +0200

    libtracker-sparql: Use more hackish ways to check for local bus notifications
    
    Bringing the tracker-bus.h header here is troublesome, since that header is
    generated later on from vala source code in the build pipeline (first comes
    this "temporary" libtracker-sparql static library, then bus/direct/remote,
    then all is merged together into the final library).
    
    In order to avoid the possible build issues this may bring, use a more
    hackish way to check for a TrackerSparqlConnection being a bus one, without
    requiring an explicit dependency on libtracker-bus at build time.

 src/libtracker-sparql/tracker-notifier.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-notifier.c b/src/libtracker-sparql/tracker-notifier.c
index 46f57b4f0..9c32478bb 100644
--- a/src/libtracker-sparql/tracker-notifier.c
+++ b/src/libtracker-sparql/tracker-notifier.c
@@ -70,7 +70,6 @@
 #include "tracker-notifier-private.h"
 #include "tracker-private.h"
 #include "tracker-sparql-enum-types.h"
-#include "bus/tracker-bus.h"
 #include <libtracker-common/tracker-common.h>
 
 typedef struct _TrackerNotifierPrivate TrackerNotifierPrivate;
@@ -334,7 +333,10 @@ get_service_name (TrackerNotifier           *notifier,
        if (!subscription)
                return NULL;
 
-       if (TRACKER_BUS_IS_CONNECTION (priv->connection)) {
+       /* This is a hackish way to find out we are dealing with DBus connections,
+        * without pulling its header.
+        */
+       if (g_object_class_find_property (G_OBJECT_CLASS (priv->connection), "bus-name")) {
                gchar *bus_name, *bus_object_path;
                gboolean is_self;
 


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