tracker r2615 - in branches/turtle: . src/libtracker-data src/tracker-indexer src/trackerd



Author: pvanhoof
Date: Mon Dec  1 09:09:17 2008
New Revision: 2615
URL: http://svn.gnome.org/viewvc/tracker?rev=2615&view=rev

Log:
2008-12-01  Philip Van Hoof  <philip codeminded be>

	* src/tracker-indexer/tracker-removable-device.c
	* src/libtracker-data/tracker-turtle.c
	* src/libtracker-data/tracker-turtle.h
	* src/trackerd/tracker-backup.c: Cleaning up code, fixed an #ifdef/#endif
	placement in case you don't have raptor



Modified:
   branches/turtle/ChangeLog
   branches/turtle/src/libtracker-data/tracker-turtle.c
   branches/turtle/src/libtracker-data/tracker-turtle.h
   branches/turtle/src/tracker-indexer/tracker-removable-device.c
   branches/turtle/src/trackerd/tracker-backup.c

Modified: branches/turtle/src/libtracker-data/tracker-turtle.c
==============================================================================
--- branches/turtle/src/libtracker-data/tracker-turtle.c	(original)
+++ branches/turtle/src/libtracker-data/tracker-turtle.c	Mon Dec  1 09:09:17 2008
@@ -25,16 +25,15 @@
 
 #include "tracker-turtle.h"
 
-#ifdef HAVE_RAPTOR
-
 #include <stdlib.h>
 #include <string.h>
 #include <sys/statvfs.h>
 
 #include <glib/gstdio.h>
 #include <gio/gio.h>
-#include <raptor.h>
 
+#ifdef HAVE_RAPTOR
+#include <raptor.h>
 #endif /* HAVE_RAPTOR */
 
 static gboolean initialized = FALSE;

Modified: branches/turtle/src/libtracker-data/tracker-turtle.h
==============================================================================
--- branches/turtle/src/libtracker-data/tracker-turtle.h	(original)
+++ branches/turtle/src/libtracker-data/tracker-turtle.h	Mon Dec  1 09:09:17 2008
@@ -34,7 +34,16 @@
 #include <raptor.h>
 typedef raptor_statement stmt;
 #else
-typedef void stmt;
+typedef struct {
+  const void *subject;
+  int subject_type;
+  const void *predicate;
+  int predicate_type;
+  const void *object;
+  int object_type;
+  void *object_literal_datatype;
+  const unsigned char *object_literal_language;
+} stmt;
 #endif
 
 typedef void (* TurtleTripleCallback) (void *user_data, const stmt *triple);

Modified: branches/turtle/src/tracker-indexer/tracker-removable-device.c
==============================================================================
--- branches/turtle/src/tracker-indexer/tracker-removable-device.c	(original)
+++ branches/turtle/src/tracker-indexer/tracker-removable-device.c	Mon Dec  1 09:09:17 2008
@@ -433,6 +433,7 @@
 	raptor_serialize_start_to_file_handle (info->serializer, 
 					       suri, target_file);
 
+				// todo
 	set_metadata ("rdf:type", "File", info);
 
 	tracker_data_metadata_foreach (metadata, 

Modified: branches/turtle/src/trackerd/tracker-backup.c
==============================================================================
--- branches/turtle/src/trackerd/tracker-backup.c	(original)
+++ branches/turtle/src/trackerd/tracker-backup.c	Mon Dec  1 09:09:17 2008
@@ -25,7 +25,10 @@
 #include <libtracker-data/tracker-data-query.h>
 #include <libtracker-data/tracker-turtle.h>
 #include <glib.h>
+
+#ifdef HAVE_RAPTOR
 #include <raptor.h>
+#endif
 
 /* TODO (obviously) */
 #define TODO_TEMPORARY_LOCATION "/tmp/tracker-saving-things.ttl"
@@ -42,12 +45,11 @@
 	TrackerDataMetadata *metadata;
 	TurtleFile          *turtle_file;
 
-        tracker_turtle_init ();
-
 	/* TODO: temporary location */
-        if (g_file_test (TODO_TEMPORARY_LOCATION, G_FILE_TEST_EXISTS)) {
-                g_unlink (TODO_TEMPORARY_LOCATION);
-        }
+	if (g_file_test (TODO_TEMPORARY_LOCATION, G_FILE_TEST_EXISTS)) {
+		g_unlink (TODO_TEMPORARY_LOCATION);
+	}
+
 	turtle_file = tracker_turtle_open (TODO_TEMPORARY_LOCATION);
 
 	while (valid) {
@@ -57,9 +59,10 @@
 		gchar *uri;
 
 		g_value_init (&transform, G_TYPE_STRING);
+
 		tracker_db_result_set_get (result_set, 0, &uri, -1);
 		tracker_db_result_set_get (result_set, 1, &metadata_id, -1);
-                tracker_db_result_set_get (result_set, 2, &str, -1);
+		tracker_db_result_set_get (result_set, 2, &str, -1);
 
 		field = tracker_ontology_get_field_by_id (metadata_id);
 		if (!field) {
@@ -70,7 +73,7 @@
 		}
 
 		g_debug ("Insertion in turtle <%s, %s, %s>",
-                         uri, tracker_field_get_name (field), str);
+			 uri, tracker_field_get_name (field), str);
 		tracker_turtle_add_triple (turtle_file, uri, field, str);
 
 		g_free (str);
@@ -90,8 +93,6 @@
 
 	g_message ("***** tracker_backup: Saving metadata in turtle file *****");
 
-        tracker_turtle_init ();
-        
 	service = tracker_ontology_get_service_by_name ("Files");
 	data = tracker_data_query_backup_metadata (service);
 
@@ -101,18 +102,9 @@
 	}
 }
 
-
 static void 
 loading_turtle (void *user_data, const stmt *triple) 
 {
-#ifdef HAVE_RAPTOR
-        g_debug ("turtle loading <%s, %s, %s>\n",
-                 (gchar *)triple->subject, 
-                 (gchar *)triple->predicate, 
-                 (gchar *)triple->object);
-#else
-        g_debug ("No raptor support to restore metadata");
-#endif
 }
 
 void 



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