[tracker/wip/carlosg/sandboxed-notifiers: 9/10] libtracker-sparql: Expand graph on tracker_notifier_signal_subscribe()




commit 62d73ea39ee80d6a2f2ab1203fdb3088079e1a8d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Feb 20 23:25:01 2021 +0100

    libtracker-sparql: Expand graph on tracker_notifier_signal_subscribe()
    
    Implicitly expand the graph URI, in case we are given a prefixed name.

 src/libtracker-sparql/tracker-notifier.c | 15 +++++++++++++--
 1 file 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;
 }


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