Deal with thumbnail failure correctly

If a file already has a failed thumbnail indicator, don't try to
thumbnail it, and if thumbnailing fails, create a failed thumbnail
indicator. (In particular, so that if thumbnail creation times out, we
don't keep retrying and eventually timing out every time the user
opens the overlay.)

http://bugzilla.gnome.org/show_bug.cgi?id=568081
This commit is contained in:
Dan Winship 2009-05-05 14:10:06 -04:00
parent 7fc4560e86
commit 84d469c1f9

View File

@ -372,17 +372,20 @@ shell_get_thumbnail_for_recent_info(GtkRecentInfo *recent_info)
g_clear_error (&error);
}
}
else if (gnome_thumbnail_factory_has_valid_failed_thumbnail (thumbnail_factory, uri, mtime))
return NULL;
else if (gnome_thumbnail_factory_can_thumbnail (thumbnail_factory, uri, mime_type, mtime))
{
pixbuf = gnome_thumbnail_factory_generate_thumbnail (thumbnail_factory, uri, mime_type);
if (pixbuf == NULL)
{
g_warning ("Could not generate thumbnail for %s", uri);
}
else
if (pixbuf)
{
// we need to save the thumbnail so that we don't need to generate it again in the future
gnome_thumbnail_factory_save_thumbnail (thumbnail_factory, pixbuf, uri, mtime);
}
else
{
g_warning ("Could not generate thumbnail for %s", uri);
gnome_thumbnail_factory_create_failed_thumbnail (thumbnail_factory, uri, mtime);
}
}