[tracker/wip/carlosg/domain-ontologies: 92/93] libtracker-sparql: Make TrackerNotifier check GraphUpdated from the domain
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/domain-ontologies: 92/93] libtracker-sparql: Make TrackerNotifier check GraphUpdated from the domain
- Date: Mon, 19 Jun 2017 23:07:56 +0000 (UTC)
commit 9628c389a752c9d5fd33b5b4f9c752f772792651
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jun 19 22:53:46 2017 +0200
libtracker-sparql: Make TrackerNotifier check GraphUpdated from the domain
It must listen to the signal from the right tracker-store instance.
src/libtracker-sparql/tracker-notifier.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-notifier.c b/src/libtracker-sparql/tracker-notifier.c
index 4b036c7..66fea83 100644
--- a/src/libtracker-sparql/tracker-notifier.c
+++ b/src/libtracker-sparql/tracker-notifier.c
@@ -87,6 +87,7 @@
#include "tracker-notifier.h"
#include "tracker-sparql-enum-types.h"
#include "tracker-generated-no-checks.h"
+#include <libtracker-common/tracker-common.h>
typedef struct _TrackerNotifierPrivate TrackerNotifierPrivate;
typedef struct _TrackerNotifierEventCache TrackerNotifierEventCache;
@@ -134,6 +135,8 @@ static guint signals[N_SIGNALS] = { 0 };
static void tracker_notifier_initable_iface_init (GInitableIface *iface);
+extern TrackerDomainOntology *domain_ontology;
+
G_DEFINE_TYPE_WITH_CODE (TrackerNotifier, tracker_notifier, G_TYPE_OBJECT,
G_ADD_PRIVATE (TrackerNotifier)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
@@ -688,6 +691,7 @@ tracker_notifier_initable_init (GInitable *initable,
{
TrackerNotifier *notifier = TRACKER_NOTIFIER (initable);
TrackerNotifierPrivate *priv;
+ gchar *dbus_name;
priv = tracker_notifier_get_instance_private (notifier);
priv->connection = tracker_sparql_connection_get (cancellable, error);
@@ -705,11 +709,13 @@ tracker_notifier_initable_init (GInitable *initable,
if (!priv->dbus_connection)
return FALSE;
+ dbus_name = tracker_domain_ontology_get_domain (domain_ontology, NULL);
+
priv->has_arg0_filter =
priv->expanded_classes && g_strv_length (priv->expanded_classes) == 1;
priv->graph_updated_signal_id =
g_dbus_connection_signal_subscribe (priv->dbus_connection,
- TRACKER_DBUS_SERVICE,
+ dbus_name,
TRACKER_DBUS_INTERFACE_RESOURCES,
"GraphUpdated",
TRACKER_DBUS_OBJECT_RESOURCES,
@@ -717,6 +723,7 @@ tracker_notifier_initable_init (GInitable *initable,
G_DBUS_SIGNAL_FLAGS_NONE,
graph_updated_cb,
initable, NULL);
+ g_free (dbus_name);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]