[maemo-commits] [maemo-commits] r16484 - projects/haf/trunk/hildon-thumbnail/thumbs
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Fri Oct 24 13:01:12 EEST 2008
- Previous message: [maemo-commits] r16483 - in projects/haf/trunk/hildon-thumbnail: . daemon daemon/plugins thumbs
- Next message: [maemo-commits] r16485 - in projects/haf/trunk/hildon-thumbnail: . daemon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: pvanhoof Date: 2008-10-24 13:01:11 +0300 (Fri, 24 Oct 2008) New Revision: 16484 Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-obj.c Log: Bugfix in new library Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-obj.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-obj.c 2008-10-24 09:53:43 UTC (rev 16483) +++ projects/haf/trunk/hildon-thumbnail/thumbs/hildon-thumbnail-obj.c 2008-10-24 10:01:11 UTC (rev 16484) @@ -79,44 +79,39 @@ static void create_pixbuf_and_callback (HildonThumbnailRequestPrivate *r_priv) { - GFile *filei = NULL; + GFile *filei = NULL, *local = NULL; GInputStream *stream = NULL; GdkPixbuf *pixbuf = NULL; - gchar *path; GError *error = NULL; - gboolean uris = FALSE; - + /* Determine the exact type of thumbnail being requested */ if (r_priv->cropped) { - if (!g_file_test (r_priv->lpaths[2], G_FILE_TEST_EXISTS)) - path = r_priv->paths[2]; - else { - path = r_priv->lpaths[2]; - uris = TRUE; + local = g_file_new_for_uri (r_priv->lpaths[2]); + if (!g_file_query_exists (local, NULL)) { + filei = g_file_new_for_path (r_priv->paths[2]); + g_object_unref (local); + } else { + filei = local; } } else if (r_priv->width > 128) { - if (!g_file_test (r_priv->lpaths[1], G_FILE_TEST_EXISTS)) - path = r_priv->paths[1]; - else { - path = r_priv->lpaths[1]; - uris = TRUE; + local = g_file_new_for_uri (r_priv->lpaths[1]); + if (!g_file_query_exists (local, NULL)) { + filei = g_file_new_for_path (r_priv->paths[1]); + g_object_unref (local); + } else { + filei = local; } } else { - if (!g_file_test (r_priv->lpaths[0], G_FILE_TEST_EXISTS)) - path = r_priv->paths[0]; - else { - path = r_priv->lpaths[0]; - uris = TRUE; + local = g_file_new_for_uri (r_priv->lpaths[0]); + if (!g_file_query_exists (local, NULL)) { + filei = g_file_new_for_path (r_priv->paths[0]); + g_object_unref (local); + } else { + filei = local; } } - /* Open the original thumbnail as a stream */ - if (uris) - filei = g_file_new_for_uri (path); - else - filei = g_file_new_for_path (path); - stream = G_INPUT_STREAM (g_file_read (filei, NULL, &error)); if (error)
- Previous message: [maemo-commits] r16483 - in projects/haf/trunk/hildon-thumbnail: . daemon daemon/plugins thumbs
- Next message: [maemo-commits] r16485 - in projects/haf/trunk/hildon-thumbnail: . daemon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]