tracker r3040 - in trunk: . src/tracker-indexer



Author: carlosg
Date: Tue Mar 10 12:07:33 2009
New Revision: 3040
URL: http://svn.gnome.org/viewvc/tracker?rev=3040&view=rev

Log:
2009-03-10  Carlos Garnacho  <carlos imendio com>

        * src/tracker-indexer/tracker-removable-device.c
        (get_uri_with_trailing_slash) (consume_triple_storer)
        (tracker_removable_device_load)
        (tracker_removable_device_add_metadata)
        (tracker_removable_device_add_removal)
        (tracker_removable_device_add_move): Generate URIs with trailing slash
        where appropriate, since raptor likes them.

Modified:
   trunk/ChangeLog
   trunk/src/tracker-indexer/tracker-removable-device.c

Modified: trunk/src/tracker-indexer/tracker-removable-device.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-removable-device.c	(original)
+++ trunk/src/tracker-indexer/tracker-removable-device.c	Tue Mar 10 12:07:33 2009
@@ -154,6 +154,18 @@
 	}
 }
 
+static gchar *
+get_uri_with_trailing_slash (GFile *file)
+{
+	gchar *uri, *str;
+
+	uri = g_file_get_uri (file);
+	str = g_strdup_printf ("%s/", uri);
+	g_free (uri);
+
+	return str;
+}
+
 static void
 consume_triple_storer (void* user_data, const raptor_statement* triple) 
 {
@@ -197,7 +209,7 @@
 		gchar *key;
 
 		file = g_file_new_for_path (info->base);
-		key = g_file_get_uri (file);
+		key = get_uri_with_trailing_slash (file);
 
 		if (g_strcmp0 (key, triple->object) == 0 &&
 		    g_strcmp0 (key, triple->predicate) == 0) {
@@ -284,7 +296,7 @@
 		tracker_indexer_transaction_open (info->indexer);
 
 		file = g_file_new_for_path (mount_point);
-		base_uri = g_file_get_uri (file);
+		base_uri = get_uri_with_trailing_slash (file);
 
 		tracker_turtle_process (filename, base_uri, consume_triple_storer, info);
 
@@ -381,7 +393,7 @@
 	gchar           *filename, *muri;
 	FILE            *target_file;
 	raptor_uri      *suri;
-	GFile           *file;
+	GFile           *file, *base_file;
 
 	filename = g_build_filename (mount_point, ".cache",
 				     "metadata", NULL);
@@ -415,11 +427,13 @@
 				       RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES, 1);
 
 	file = g_file_new_for_path (mount_point);
-	muri = g_file_get_uri (file);
+	base_file = g_file_get_child (file, "base");
+	muri = g_file_get_uri (base_file);
 
 	suri = raptor_new_uri ((const unsigned char *) muri);
 
 	g_object_unref (file);
+	g_object_unref (base_file);
 	g_free (muri);
 
 	raptor_serialize_start_to_file_handle (info->serializer, 
@@ -484,12 +498,12 @@
 
 	file = g_file_new_for_path (mount_point);
 	base_file = g_file_get_child (file, "base");
-	g_object_unref (file);
 
 	muri = g_file_get_uri (base_file);
 	suri = raptor_new_uri ((const unsigned char *) muri);
 
 	g_object_unref (base_file);
+	g_object_unref (file);
 	g_free (muri);
 
 	raptor_serialize_start_to_file_handle (serializer, 
@@ -558,7 +572,7 @@
 	to_uri = g_strdup (to_path+strlen (mount_point)+1);
 
 	file = g_file_new_for_path (mount_point);
-	muri = g_file_get_uri (file);
+	muri = get_uri_with_trailing_slash (file);
 	suri = raptor_new_uri ((const unsigned char *) muri);
 
 	g_object_unref (file);



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