[maemo-commits] [maemo-commits] r16550 - projects/haf/trunk/hildon-thumbnail/thumbs
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Fri Oct 31 17:04:21 EET 2008
- Previous message: [maemo-commits] r16549 - projects/haf/trunk/hildon-thumbnail/thumbs
- Next message: [maemo-commits] r16551 - projects/haf/trunk/hildon-thumbnail/thumbs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: pvanhoof
Date: 2008-10-31 17:04:20 +0200 (Fri, 31 Oct 2008)
New Revision: 16550
Modified:
projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.c
projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.h
Log:
Bugfixes
Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.c
===================================================================
--- projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.c 2008-10-31 14:39:48 UTC (rev 16549)
+++ projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.c 2008-10-31 15:04:20 UTC (rev 16550)
@@ -751,19 +751,21 @@
hildon_thumbnail_is_cached (const gchar *uri, guint width, guint height, gboolean is_cropped)
{
gboolean retval;
- gchar *path;
+ gchar *urif;
+ GFile *file;
- path = hildon_thumbnail_get_path (uri, width, height, is_cropped);
+ urif = hildon_thumbnail_get_uri (uri, width, height, is_cropped);
+ file = g_file_new_for_uri (urif);
- retval = g_file_test (path, G_FILE_TEST_EXISTS);
+ retval = g_file_query_exists (file, NULL);
- g_free (path);
+ g_free (urif);
return retval;
}
gchar *
-hildon_thumbnail_get_path (const gchar *uri, guint width, guint height, gboolean is_cropped)
+hildon_thumbnail_get_uri (const gchar *uri, guint width, guint height, gboolean is_cropped)
{
gchar *large, *normal, *cropped, *local_large, *local_normal, *local_cropped;
gchar *path;
@@ -785,16 +787,16 @@
GFile *fnormal = g_file_new_for_uri (local_normal);
if (g_file_query_exists (fnormal, NULL))
- path = g_strdup (local_normal);
+ path = g_strdup_printf ("file://%s", local_normal);
else
- path = g_strdup (normal);
+ path = g_strdup_printf ("file://%s", normal);
g_object_unref (fnormal);
} else {
GFile *flarge = g_file_new_for_uri (local_large);
if (g_file_query_exists (flarge, NULL))
path = g_strdup (local_large);
else
- path = g_strdup (large);
+ path = g_strdup_printf ("file://%s", large);
g_object_unref (flarge);
}
Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.h
===================================================================
--- projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.h 2008-10-31 14:39:48 UTC (rev 16549)
+++ projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-factory.h 2008-10-31 15:04:20 UTC (rev 16550)
@@ -205,19 +205,19 @@
gboolean hildon_thumbnail_is_cached (const gchar *uri, guint width, guint height, gboolean is_cropped);
/**
- * hildon_thumbnail_get_path:
+ * hildon_thumbnail_get_uri:
* @uri: URI of the original
* @width: width
* @height: height
* @is_cropped: is cropped
*
- * Gives you the absolute predicted path to the thumbnail for @uri. This function
+ * Gives you the absolute predicted URI to the thumbnail for @uri. This function
* doesn't care about the thumbnail having been created (cached) already or not,
* it just returns the predicted path.
*
- * Returns: (caller-owns): the path to the thumbnail. You must free this.
+ * Returns: (caller-owns): the uri to the thumbnail. You must free this.
**/
-gchar * hildon_thumbnail_get_path (const gchar *uri, guint width, guint height, gboolean is_cropped);
+gchar * hildon_thumbnail_get_uri (const gchar *uri, guint width, guint height, gboolean is_cropped);
- Previous message: [maemo-commits] r16549 - projects/haf/trunk/hildon-thumbnail/thumbs
- Next message: [maemo-commits] r16551 - projects/haf/trunk/hildon-thumbnail/thumbs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
