[tracker/wip/carlosg/sparql-parser-ng: 35/50] libtracker-data: Flip the TrackerSparql switch



commit 42c6db1c7ead50ea89bdf80ad0aa299518189815
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 6 19:26:28 2018 +0200

    libtracker-data: Flip the TrackerSparql switch
    
    From now on, TrackerSparql will be used for handling SPARQL queries.

 src/libtracker-data/tracker-data-query.c  | 12 ++++++------
 src/libtracker-data/tracker-data-update.c |  7 ++++---
 src/libtracker-direct/tracker-direct.c    |  8 +++++---
 3 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-query.c b/src/libtracker-data/tracker-data-query.c
index b6f553fbb..aebfacf61 100644
--- a/src/libtracker-data/tracker-data-query.c
+++ b/src/libtracker-data/tracker-data-query.c
@@ -31,7 +31,7 @@
 #include "tracker-db-interface-sqlite.h"
 #include "tracker-db-manager.h"
 #include "tracker-ontologies.h"
-#include "tracker-sparql-query.h"
+#include "tracker-sparql.h"
 
 GPtrArray*
 tracker_data_query_rdf_type (TrackerDataManager *manager,
@@ -169,17 +169,17 @@ tracker_data_query_sparql_cursor (TrackerDataManager  *manager,
                                   const gchar         *query,
                                   GError             **error)
 {
-       TrackerSparqlQuery *sparql_query;
-       TrackerDBCursor *cursor;
+       TrackerSparql *sparql_query;
+       TrackerSparqlCursor *cursor;
 
        g_return_val_if_fail (query != NULL, NULL);
 
-       sparql_query = tracker_sparql_query_new (manager, query);
+       sparql_query = tracker_sparql_new (manager, query);
 
-       cursor = tracker_sparql_query_execute_cursor (sparql_query, error);
+       cursor = tracker_sparql_execute_cursor (sparql_query, error);
 
        g_object_unref (sparql_query);
 
-       return cursor;
+       return TRACKER_DB_CURSOR (cursor);
 }
 
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 444e5efee..e687505bf 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -38,6 +38,7 @@
 #include "tracker-ontologies.h"
 #include "tracker-property.h"
 #include "tracker-sparql-query.h"
+#include "tracker-sparql.h"
 
 typedef struct _TrackerDataUpdateBuffer TrackerDataUpdateBuffer;
 typedef struct _TrackerDataUpdateBufferResource TrackerDataUpdateBufferResource;
@@ -3687,7 +3688,7 @@ update_sparql (TrackerData  *data,
                GError      **error)
 {
        GError *actual_error = NULL;
-       TrackerSparqlQuery *sparql_query;
+       TrackerSparql *sparql_query;
        GVariant *blank_nodes;
 
        g_return_val_if_fail (update != NULL, NULL);
@@ -3698,8 +3699,8 @@ update_sparql (TrackerData  *data,
                return NULL;
        }
 
-       sparql_query = tracker_sparql_query_new_update (data->manager, update);
-       blank_nodes = tracker_sparql_query_execute_update (sparql_query, blank, &actual_error);
+       sparql_query = tracker_sparql_new_update (data->manager, update);
+       blank_nodes = tracker_sparql_execute_update (sparql_query, blank, &actual_error);
        g_object_unref (sparql_query);
 
        if (actual_error) {
diff --git a/src/libtracker-direct/tracker-direct.c b/src/libtracker-direct/tracker-direct.c
index 674b8b7a5..66409991b 100644
--- a/src/libtracker-direct/tracker-direct.c
+++ b/src/libtracker-direct/tracker-direct.c
@@ -22,6 +22,7 @@
 
 #include "tracker-direct.h"
 #include <libtracker-data/tracker-data.h>
+#include <libtracker-data/tracker-sparql.h>
 
 static TrackerDBManagerFlags default_flags = 0;
 
@@ -428,16 +429,17 @@ tracker_direct_connection_query (TrackerSparqlConnection  *self,
 {
        TrackerDirectConnectionPrivate *priv;
        TrackerDirectConnection *conn;
-       TrackerSparqlQuery *query;
+       TrackerSparql *query;
        TrackerSparqlCursor *cursor;
 
        conn = TRACKER_DIRECT_CONNECTION (self);
        priv = tracker_direct_connection_get_instance_private (conn);
 
        g_mutex_lock (&priv->mutex);
-       query = tracker_sparql_query_new (priv->data_manager, sparql);
-       cursor = TRACKER_SPARQL_CURSOR (tracker_sparql_query_execute_cursor (query, error));
+       query = tracker_sparql_new (priv->data_manager, sparql);
+       cursor = tracker_sparql_execute_cursor (query, error);
        g_object_unref (query);
+
        if (cursor)
                tracker_sparql_cursor_set_connection (cursor, self);
        g_mutex_unlock (&priv->mutex);


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