diff options
Diffstat (limited to 'plugins/xdg-cache/xdg-cache-cache.c')
-rw-r--r-- | plugins/xdg-cache/xdg-cache-cache.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/xdg-cache/xdg-cache-cache.c b/plugins/xdg-cache/xdg-cache-cache.c index 15ef219..1a0c9b4 100644 --- a/plugins/xdg-cache/xdg-cache-cache.c +++ b/plugins/xdg-cache/xdg-cache-cache.c @@ -26,6 +26,7 @@ #include <string.h> #include <glib.h> +#include <glib/gi18n.h> #include <glib/gstdio.h> #include <glib/gprintf.h> #include <glib-object.h> @@ -657,6 +658,9 @@ xdg_cache_cache_get_temp_file (const gchar *uri, +/* Will return %TRUE if the thumbnail was loaded successfully, or did not exist. + * Check whether @uri is non-%NULL and @mtime is a valid time to determine + * between the two. Will return %FALSE and set @error if the PNG was corrupt. */ gboolean xdg_cache_cache_read_thumbnail_info (const gchar *filename, gchar **uri, @@ -706,6 +710,10 @@ xdg_cache_cache_read_thumbnail_info (const gchar *filename, /* close the PNG file handle */ fclose (png); + /* set an error */ + g_set_error (error, TUMBLER_ERROR, TUMBLER_ERROR_INVALID_FORMAT, + _("Corrupt thumbnail PNG: '%s'"), filename); + return FALSE; } #endif |