[tracker/wal: 9/11] libtracker-data: Add tracker_data_load_turtle_file



commit de8bb03a90aaae99cde0e2bc93d55678531fe066
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 20df803..56a727d 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2479,6 +2479,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 354c419..f6a37e1 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]