[maemo-commits] [maemo-commits] r17673 - in projects/haf/trunk/hildon-thumbnail: . daemon thumbs

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Mar 13 11:52:11 EET 2009
Author: pvanhoof
Date: 2009-03-13 11:52:10 +0200 (Fri, 13 Mar 2009)
New Revision: 17673

Modified:
   projects/haf/trunk/hildon-thumbnail/ChangeLog
   projects/haf/trunk/hildon-thumbnail/daemon/thumbnailer.c
   projects/haf/trunk/hildon-thumbnail/daemon/utils.c
   projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-obj.c
Log:
2009-03-13  Philip Van Hoof  <pvanhoof at codeminded.be>

        * thumbs/hildon-thumbnail-obj.c
        * daemon/utils.c
        * daemon/thumbnailer.c: Fixed some issues with URI vs. paths



Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-thumbnail/ChangeLog	2009-03-13 09:30:13 UTC (rev 17672)
+++ projects/haf/trunk/hildon-thumbnail/ChangeLog	2009-03-13 09:52:10 UTC (rev 17673)
@@ -1,3 +1,9 @@
+2009-03-13  Philip Van Hoof  <pvanhoof at codeminded.be>
+
+	* thumbs/hildon-thumbnail-obj.c
+	* daemon/utils.c
+	* daemon/thumbnailer.c: Fixed some issues with URI vs. paths
+
 2009-03-11  Philip Van Hoof  <pvanhoof at codeminded.be>
 
 	* thumbs/hildon-thumbnail-obj.c: Fixed a crash when joining

Modified: projects/haf/trunk/hildon-thumbnail/daemon/thumbnailer.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/daemon/thumbnailer.c	2009-03-13 09:30:13 UTC (rev 17672)
+++ projects/haf/trunk/hildon-thumbnail/daemon/thumbnailer.c	2009-03-13 09:52:10 UTC (rev 17673)
@@ -376,10 +376,11 @@
 	GList *thumb_items = NULL, *copy;
 	GStrv cached_items;
 
-	static gchar *remotefss[8] = { 
+	static gchar *remotefss[9] = { 
 		"smb://", "file:///media", 
 		"file:///mnt", "ftp://", 
 		"ftps://", "dav://", "nfs://",
+		"file:///home/user/MyDocs",
 		NULL };
 
 	g_signal_emit (task->object, signals[STARTED_SIGNAL], 0,

Modified: projects/haf/trunk/hildon-thumbnail/daemon/utils.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/daemon/utils.c	2009-03-13 09:30:13 UTC (rev 17672)
+++ projects/haf/trunk/hildon-thumbnail/daemon/utils.c	2009-03-13 09:52:10 UTC (rev 17673)
@@ -59,20 +59,16 @@
 	static gchar *normal_dir = NULL;
 	static gchar *cropped_dir = NULL;
 	gchar *local_dir = NULL;
-	GFile *file; GFileInfo *info;
 	gboolean local = (local_large || local_normal || local_cropped);
 
 	if (local) {
-		uri_t = g_strdup (uri);
-		ptr = strrchr (uri_t, '/');
+		GFileInfo *info;
+		GFile *file = g_file_new_for_uri (uri);
+		GFile *dir_file = g_file_get_parent (file);
+		GFile *thumb_file = g_file_get_child (dir_file, ".thumblocal");
 
-		if (ptr) {
-			*ptr = '\0';
-			local_dir = g_strdup_printf ("%s/.thumblocal", uri_t);
-		}
+		local_dir = g_file_get_uri (thumb_file);
 
-		g_free (uri_t);
-
 		file = g_file_new_for_uri (uri);
 		info = g_file_query_info (file,
 					  G_FILE_ATTRIBUTE_STANDARD_NAME,
@@ -85,6 +81,8 @@
 		}
 
 		g_object_unref (file);
+		g_object_unref (dir_file);
+		g_object_unref (thumb_file);
 	}
 
 	/* I know we leak, but it's better than doing memory fragementation on 

Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-obj.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-obj.c	2009-03-13 09:30:13 UTC (rev 17672)
+++ projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-obj.c	2009-03-13 09:52:10 UTC (rev 17673)
@@ -114,8 +114,10 @@
 						       (y==0));
 
 		for (i = 0; i < 3 && have; i++) {
+			gchar *localp = g_filename_from_uri (lpaths[i]);
 			have = (g_file_test (paths[i], G_FILE_TEST_EXISTS) || 
-				g_file_test (lpaths[i], G_FILE_TEST_EXISTS));
+				g_file_test (localp, G_FILE_TEST_EXISTS));
+			g_free (localp);
 		}
 	}
 
@@ -481,8 +483,10 @@
 						       (y==0));
 
 		for (i = 0; i < 3 && have; i++) {
+			gchar *localp = g_filename_from_uri (lpaths[i]);
 			have = (g_file_test (paths[i], G_FILE_TEST_EXISTS) || 
-				g_file_test (lpaths[i], G_FILE_TEST_EXISTS));
+				g_file_test (localp, G_FILE_TEST_EXISTS));
+			g_free (localp);
 		}
 	}
 


More information about the maemo-commits mailing list