[tracker/direct-access: 9/90] libtracker-data: Add tracker_data_load_turtle_file



commit 536f1f5d7f691486dd1652cc0f44ba4cf928c7e3
Author: Jürg Billeter <j bitron ch>
Date:   Fri Jul 2 16:09:40 2010 +0200

    libtracker-data: Add tracker_data_load_turtle_file

 src/libtracker-data/tracker-data-update.c      |   13 +++++++++++++
 src/libtracker-data/tracker-data-update.h      |    3 +++
 src/libtracker-data/tracker-turtle-reader.vala |    1 +
 3 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index b90c4cd..33f5d3c 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2549,6 +2549,19 @@ tracker_data_update_sparql_blank (const gchar  *update,
 }
 
 void
+tracker_data_load_turtle_file (GFile   *file,
+                               GError **error)
+{
+	gchar *path;
+
+	g_return_if_fail (G_IS_FILE (file) && g_file_is_native (file));
+
+	path = g_file_get_path (file);
+	tracker_turtle_reader_load (path, error);
+	g_free (path);
+}
+
+void
 tracker_data_sync (void)
 {
 	tracker_db_journal_fsync ();
diff --git a/src/libtracker-data/tracker-data-update.h b/src/libtracker-data/tracker-data-update.h
index 0b82f5f..cd45aaf 100644
--- a/src/libtracker-data/tracker-data-update.h
+++ b/src/libtracker-data/tracker-data-update.h
@@ -22,6 +22,7 @@
 #define __LIBTRACKER_DATA_UPDATE_H__
 
 #include <glib.h>
+#include <gio/gio.h>
 
 #include <libtracker-common/tracker-ontologies.h>
 
@@ -93,6 +94,8 @@ GPtrArray *
                                                      GError                   **error);
 void     tracker_data_update_buffer_flush           (GError                   **error);
 void     tracker_data_update_buffer_might_flush     (GError                   **error);
+void     tracker_data_load_turtle_file              (GFile                     *file,
+                                                     GError                   **error);
 
 void     tracker_data_sync                          (void);
 void     tracker_data_replay_journal                (GHashTable                *classes,
diff --git a/src/libtracker-data/tracker-turtle-reader.vala b/src/libtracker-data/tracker-turtle-reader.vala
index e16ebcc..2ab09e5 100644
--- a/src/libtracker-data/tracker-turtle-reader.vala
+++ b/src/libtracker-data/tracker-turtle-reader.vala
@@ -376,6 +376,7 @@ public class Tracker.TurtleReader : Object {
 				} else {
 					Data.insert_statement_with_string (reader.graph, reader.subject, reader.predicate, reader.object);
 				}
+				Data.update_buffer_might_flush ();
 			}
 
 			Data.commit_transaction ();



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