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:
parent
7fc4560e86
commit
84d469c1f9
@ -372,17 +372,20 @@ shell_get_thumbnail_for_recent_info(GtkRecentInfo *recent_info)
|
|||||||
g_clear_error (&error);
|
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))
|
else if (gnome_thumbnail_factory_can_thumbnail (thumbnail_factory, uri, mime_type, mtime))
|
||||||
{
|
{
|
||||||
pixbuf = gnome_thumbnail_factory_generate_thumbnail (thumbnail_factory, uri, mime_type);
|
pixbuf = gnome_thumbnail_factory_generate_thumbnail (thumbnail_factory, uri, mime_type);
|
||||||
if (pixbuf == NULL)
|
if (pixbuf)
|
||||||
{
|
|
||||||
g_warning ("Could not generate thumbnail for %s", uri);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// we need to save the thumbnail so that we don't need to generate it again in the future
|
// 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);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user