tracker r2881 - in trunk: . src/libtracker-common src/libtracker-data src/tracker-extract



Author: pvanhoof
Date: Thu Feb  5 12:20:26 2009
New Revision: 2881
URL: http://svn.gnome.org/viewvc/tracker?rev=2881&view=rev

Log:
2009-02-05  Philip Van Hoof  <philip codeminded be>

	* src/libtracker-data/tracker-turtle.c
	* src/tracker-extract/tracker-albumart.c
	* src/libtracker-common/tracker-thumbnailer.c: Using g_filename_to_uri
	instead of doing filename to uri conversion wrong



Modified:
   trunk/ChangeLog
   trunk/src/libtracker-common/tracker-thumbnailer.c
   trunk/src/libtracker-data/tracker-turtle.c
   trunk/src/tracker-extract/tracker-albumart.c

Modified: trunk/src/libtracker-common/tracker-thumbnailer.c
==============================================================================
--- trunk/src/libtracker-common/tracker-thumbnailer.c	(original)
+++ trunk/src/libtracker-common/tracker-thumbnailer.c	Thu Feb  5 12:20:26 2009
@@ -345,12 +345,12 @@
 		   private->request_id); 
 
 	if (!strstr (to_uri, ":/"))
-		to[0] = g_strdup_printf ("file://%s", to_uri);
+		to[0] = g_filename_to_uri (to_uri, NULL, NULL);
 	else
 		to[0] = g_strdup (to_uri);
 
 	if (!strstr (from_uri, ":/"))
-		from[0] = g_strdup_printf ("file://%s", from_uri);
+		from[0] = g_filename_to_uri (from_uri, NULL, NULL);
 	else
 		from[0] = g_strdup (from_uri);
 
@@ -401,7 +401,7 @@
 	private->request_id++;
 
 	if (!strstr (uri, ":/"))
-		uris[0] = g_strdup_printf ("file://%s", uri);
+		uris[0] = g_filename_to_uri (uri, NULL, NULL);
 	else
 		uris[0] = g_strdup (uri);
 
@@ -497,7 +497,7 @@
 
 	/* Add new URI (detect if we got passed a path) */
 	if (!strstr (uri, ":/"))
-		private->uris[private->count] = g_strdup_printf ("file://%s", uri);
+		private->uris[private->count] = g_filename_to_uri (uri, NULL, NULL);
 	else
 		private->uris[private->count] = g_strdup (uri);
 

Modified: trunk/src/libtracker-data/tracker-turtle.c
==============================================================================
--- trunk/src/libtracker-data/tracker-turtle.c	(original)
+++ trunk/src/libtracker-data/tracker-turtle.c	Thu Feb  5 12:20:26 2009
@@ -388,7 +388,7 @@
 	info->serializer = raptor_new_serializer ("turtle");
 	suri = raptor_new_uri ((unsigned char *) "/");
 
-	base_uri = g_strdup_printf ("file://%s", turtle_file);
+	base_uri = g_filename_to_uri (turtle_file, NULL, NULL);
 
 	raptor_serialize_start_to_file_handle (info->serializer, 
 					       suri, target_file);

Modified: trunk/src/tracker-extract/tracker-albumart.c
==============================================================================
--- trunk/src/tracker-extract/tracker-albumart.c	(original)
+++ trunk/src/tracker-extract/tracker-albumart.c	Thu Feb  5 12:20:26 2009
@@ -548,7 +548,7 @@
 
 	if (g_file_test (info->art_path, G_FILE_TEST_EXISTS)) {
 
-		gchar * asuri = g_strdup_printf ("file://%s", info->art_path);
+		gchar * asuri = g_filename_to_uri (info->art_path, NULL, NULL);
 		tracker_thumbnailer_get_file_thumbnail (asuri, "image/jpeg");
 		g_free (asuri);
 
@@ -706,7 +706,7 @@
 	if (strchr (filename, ':'))
 		filename_uri = g_strdup (filename);
 	else
-		filename_uri = g_strdup_printf ("file://%s", filename);
+		filename_uri = g_filename_to_uri (filename, NULL, NULL);
 
 	get_albumart_path (artist, album, "album", filename_uri, 
 			   &art_path, &local_uri);
@@ -765,7 +765,7 @@
 		 * device */
 
 		if (g_file_test (art_path, G_FILE_TEST_EXISTS)) {
-			gchar *asuri = g_strdup_printf ("file://%s", art_path);
+			gchar *asuri = g_filename_to_uri (art_path, NULL, NULL);
 			tracker_thumbnailer_get_file_thumbnail (asuri, "image/jpeg");
 			g_free (asuri);
 		}



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