summaryrefslogtreecommitdiff
path: root/src/libtracker-sparql/tracker-notifier.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-02-20 23:25:01 +0100
committerCarlos Garnacho <carlosg@gnome.org>2021-02-20 23:29:57 +0100
commit62d73ea39ee80d6a2f2ab1203fdb3088079e1a8d (patch)
tree247c2658dd3032688e0e81681601d711cc40823b /src/libtracker-sparql/tracker-notifier.c
parent58d96af3484a2957fa6d982c8ade816aa0c4a42c (diff)
downloadtracker-62d73ea39ee80d6a2f2ab1203fdb3088079e1a8d.tar.gz
libtracker-sparql: Expand graph on tracker_notifier_signal_subscribe()
Implicitly expand the graph URI, in case we are given a prefixed name.
Diffstat (limited to 'src/libtracker-sparql/tracker-notifier.c')
-rw-r--r--src/libtracker-sparql/tracker-notifier.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/libtracker-sparql/tracker-notifier.c b/src/libtracker-sparql/tracker-notifier.c
index fce0cbde5..9fe293cb9 100644
--- a/src/libtracker-sparql/tracker-notifier.c
+++ b/src/libtracker-sparql/tracker-notifier.c
@@ -812,7 +812,7 @@ tracker_notifier_signal_subscribe (TrackerNotifier *notifier,
{
TrackerNotifierSubscription *subscription;
TrackerNotifierPrivate *priv;
- gchar *dbus_name = NULL, *dbus_path = NULL;
+ gchar *dbus_name = NULL, *dbus_path = NULL, *full_graph = NULL;
g_return_val_if_fail (TRACKER_IS_NOTIFIER (notifier), 0);
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0);
@@ -823,6 +823,16 @@ tracker_notifier_signal_subscribe (TrackerNotifier *notifier,
if (!object_path)
object_path = DEFAULT_OBJECT_PATH;
+ if (graph) {
+ TrackerNamespaceManager *namespaces;
+
+ namespaces = tracker_sparql_connection_get_namespace_manager (priv->connection);
+ if (namespaces) {
+ full_graph = tracker_namespace_manager_expand_uri (namespaces,
+ graph);
+ }
+ }
+
tracker_sparql_connection_lookup_dbus_service (priv->connection,
service,
object_path,
@@ -838,7 +848,7 @@ tracker_notifier_signal_subscribe (TrackerNotifier *notifier,
"org.freedesktop.Tracker3.Endpoint",
"GraphUpdated",
dbus_path ? dbus_path : object_path,
- graph,
+ full_graph ? full_graph : graph,
G_DBUS_SIGNAL_FLAGS_NONE,
graph_updated_cb,
subscription, NULL);
@@ -849,6 +859,7 @@ tracker_notifier_signal_subscribe (TrackerNotifier *notifier,
g_free (dbus_name);
g_free (dbus_path);
+ g_free (full_graph);
return subscription->handler_id;
}