[maemo-commits] [maemo-commits] r16447 - in projects/haf/trunk/hildon-thumbnail: . thumbs
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Oct 21 19:10:26 EEST 2008
- Previous message: [maemo-commits] r16446 - in projects/haf/trunk/hildon-thumbnail: . thumbs
- Next message: [maemo-commits] r16448 - projects/haf/trunk/hildon-thumbnail/thumbs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: pvanhoof Date: 2008-10-21 19:10:25 +0300 (Tue, 21 Oct 2008) New Revision: 16447 Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog projects/haf/trunk/hildon-thumbnail/thumbs/hildon-albumart-factory.c projects/haf/trunk/hildon-thumbnail/thumbs/hildon-albumart-factory.h Log: 2008-10-21 Philip Van Hoof <philip at codeminded.be> * thumbs/hildon-albumart-factory.c * thumbs/hildon-albumart-factory.h: Returning caller-owns for a boolean based API is unconvenient in the C world (that has no GC). Modified: projects/haf/trunk/hildon-thumbnail/ChangeLog =================================================================== --- projects/haf/trunk/hildon-thumbnail/ChangeLog 2008-10-21 16:07:38 UTC (rev 16446) +++ projects/haf/trunk/hildon-thumbnail/ChangeLog 2008-10-21 16:10:25 UTC (rev 16447) @@ -1,5 +1,11 @@ 2008-10-21 Philip Van Hoof <philip at codeminded.be> + * thumbs/hildon-albumart-factory.c + * thumbs/hildon-albumart-factory.h: Returning caller-owns for a boolean + based API is unconvenient in the C world (that has no GC). + +2008-10-21 Philip Van Hoof <philip at codeminded.be> + * thumbs/hildon-thumbnail-obj.c * thumbs/hildon-albumart-obj.c * thumbs/hildon-albumart-factory.h: Introduction to a convenience API Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-albumart-factory.c =================================================================== --- projects/haf/trunk/hildon-thumbnail/thumbs/hildon-albumart-factory.c 2008-10-21 16:07:38 UTC (rev 16446) +++ projects/haf/trunk/hildon-thumbnail/thumbs/hildon-albumart-factory.c 2008-10-21 16:10:25 UTC (rev 16447) @@ -96,19 +96,19 @@ g_free(item); } -gchar * +gboolean hildon_albumart_is_cached (const gchar *artist_or_title, const gchar *album, const gchar *kind) { gchar *path; + gboolean retval = FALSE; hildon_thumbnail_util_get_albumart_path (artist_or_title, album, kind, &path); - if (!g_file_test (path, G_FILE_TEST_EXISTS)) { - g_free (path); - path = NULL; - } + retval = g_file_test (path, G_FILE_TEST_EXISTS); - return path; + g_free (path); + + return retval; } gchar * Modified: projects/haf/trunk/hildon-thumbnail/thumbs/hildon-albumart-factory.h =================================================================== --- projects/haf/trunk/hildon-thumbnail/thumbs/hildon-albumart-factory.h 2008-10-21 16:07:38 UTC (rev 16446) +++ projects/haf/trunk/hildon-thumbnail/thumbs/hildon-albumart-factory.h 2008-10-21 16:10:25 UTC (rev 16447) @@ -137,15 +137,12 @@ * @album: (null-ok): Album of the media or NULL if not applicable * @kind: "album", "podcast" or "radio" (depending on what the albumart downloaders support) * - * Gives you the absolute predicted path to the art for this media. This function - * cares about the media having been downloaded (cached) already or not, if the - * art is not yet cached then it will return NULL. Else it will return the path - * to the cached art. + * Determines whether or not the album art is already cached. * - * Returns: (caller-owns) (null-ok): the path to the media. If not NULL, you must free this. + * Returns: Whether or not the album art is cached already **/ -gchar * hildon_albumart_is_cached (const gchar *artist_or_title, const gchar *album, const gchar *kind); +gboolean hildon_albumart_is_cached (const gchar *artist_or_title, const gchar *album, const gchar *kind); /** * hildon_albumart_get_path:
- Previous message: [maemo-commits] r16446 - in projects/haf/trunk/hildon-thumbnail: . thumbs
- Next message: [maemo-commits] r16448 - projects/haf/trunk/hildon-thumbnail/thumbs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]