tracker r2611 - in branches/turtle: . src/libtracker-common src/tracker-indexer



Author: pvanhoof
Date: Fri Nov 28 15:01:28 2008
New Revision: 2611
URL: http://svn.gnome.org/viewvc/tracker?rev=2611&view=rev

Log:
2008-11-28  Philip Van Hoof  <philip codeminded be>

	* src/tracker-indexer/tracker-removable-device.c
	* src/libtracker-common/tracker-hal.c: Various bugfixes for the Turtle
	support



Modified:
   branches/turtle/ChangeLog
   branches/turtle/src/libtracker-common/tracker-hal.c
   branches/turtle/src/tracker-indexer/tracker-removable-device.c

Modified: branches/turtle/src/libtracker-common/tracker-hal.c
==============================================================================
--- branches/turtle/src/libtracker-common/tracker-hal.c	(original)
+++ branches/turtle/src/libtracker-common/tracker-hal.c	Fri Nov 28 15:01:28 2008
@@ -1182,7 +1182,8 @@
 
 		mp = libhal_volume_get_mount_point (volume);
 
-		if (g_strrstr (path, mp)) {
+		if (strcmp (mp, path) != 0) {
+		  if (g_strrstr (path, mp)) {
 			found = TRUE;
 
 			if (mount_point)
@@ -1191,6 +1192,7 @@
 			if (available)
 				*available = libhal_volume_is_mounted (volume);
 			break;
+		  }
 		}
 
 		libhal_volume_free (volume);

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	Fri Nov 28 15:01:28 2008
@@ -387,7 +387,7 @@
 {
 #ifdef HAVE_RAPTOR
 	AddMetadataInfo *info = g_slice_new (AddMetadataInfo);
-	gchar           *file;
+	gchar           *file, *muri;
 	FILE            *target_file;
 	raptor_uri      *suri;
 
@@ -411,9 +411,20 @@
 	}
 
 	info->serializer = raptor_new_serializer ("turtle");
-	info->about_uri = g_strdup_printf ("file://%s", path);
+	info->about_uri = g_strdup (path+strlen (mount_point)+1);
 
-	suri = raptor_new_uri ("/");
+	raptor_serializer_set_feature (info->serializer, 
+				       RAPTOR_FEATURE_WRITE_BASE_URI, 0);
+
+	raptor_serializer_set_feature (info->serializer, 
+				       RAPTOR_FEATURE_ASSUME_IS_RDF, 1);
+
+	raptor_serializer_set_feature (info->serializer, 
+				       RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES, 1);
+
+	muri = g_strdup_printf ("file://%s/base", mount_point);
+	suri = raptor_new_uri (muri);
+	g_free (muri);
 
 	raptor_serialize_start_to_file_handle (info->serializer, 
 					       suri, target_file);
@@ -443,7 +454,7 @@
 				      const gchar *path)
 {
 #ifdef HAVE_RAPTOR
-	gchar               *file, *about_uri, *dirname;
+	gchar               *file, *about_uri, *dirname, *muri;
 	FILE                *target_file;
 	raptor_uri          *suri;
 	raptor_statement    *statement;
@@ -469,9 +480,10 @@
 	}
 
 	serializer = raptor_new_serializer ("turtle");
-	about_uri = g_strdup_printf ("file://%s", path);
+	about_uri = g_strdup (path+strlen (mount_point)+1);
 
-	suri = raptor_new_uri ("/");
+	raptor_serializer_set_feature (serializer, 
+				       RAPTOR_FEATURE_WRITE_BASE_URI, 0);
 
 	raptor_serialize_start_to_file_handle (serializer, 
 					       suri, target_file);
@@ -500,7 +512,6 @@
 	raptor_serialize_end (serializer);
 	raptor_free_serializer (serializer);
 	fclose (target_file);
-	raptor_free_uri (suri);
 
 #endif /* HAVE_RAPTOR */
 }
@@ -514,7 +525,7 @@
 				   const gchar *to_path)
 {
 #ifdef HAVE_RAPTOR
-	gchar               *file, *about_uri, *to_uri;
+	gchar               *file, *about_uri, *to_uri, *muri;
 	FILE                *target_file;
 	raptor_uri          *suri;
 	raptor_statement    *statement;
@@ -540,10 +551,16 @@
 	}
 
 	serializer = raptor_new_serializer ("turtle");
-	about_uri = g_strdup_printf ("file://%s", from_path);
-	to_uri = g_strdup_printf ("file://%s", to_path);
 
-	suri = raptor_new_uri ("/");
+	raptor_serializer_set_feature (serializer, 
+				       RAPTOR_FEATURE_WRITE_BASE_URI, 0);
+
+	about_uri = g_strdup (from_path+strlen (mount_point)+1);
+	to_uri = g_strdup (to_path+strlen (mount_point)+1);
+
+	muri = g_strdup_printf ("file://%s/", mount_point);
+	suri = raptor_new_uri (muri);
+	g_free (muri);
 
 	raptor_serialize_start_to_file_handle (serializer, 
 					       suri, target_file);



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