Commit 41a08e56 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

Fix thumbnail handling. Always request thumbnailing if a file without any

2008-06-11  Christian Neumair  <cneumair@gnome.org>

	* libnautilus-private/nautilus-file.c (update_info_internal),
	(nautilus_file_get_icon):
	* libnautilus-private/nautilus-thumbnails.c
	(nautilus_has_valid_failed_thumbnail):
	* libnautilus-private/nautilus-thumbnails.h:
	Fix thumbnail handling. Always request thumbnailing if a file without
	any thumbnail changes its mtime, or if a failed thumbnail is not up to
	date (i.e. its mtime differs from the file's mtime).

svn path=/trunk/; revision=14255
parent 90cb6baa
2008-06-11 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-file.c (update_info_internal),
(nautilus_file_get_icon):
* libnautilus-private/nautilus-thumbnails.c
(nautilus_has_valid_failed_thumbnail):
* libnautilus-private/nautilus-thumbnails.h:
Fix thumbnail handling. Always request thumbnailing if a file without
any thumbnail changes its mtime, or if a failed thumbnail is not up to
date (i.e. its mtime differs from the file's mtime).
2008-06-08 German Poo-Caamano <gpoo@gnome.org>
* src/nautilus-window-menus.c:
......
......@@ -1750,6 +1750,10 @@ update_info_internal (NautilusFile *file,
if (file->details->atime != atime ||
file->details->mtime != mtime ||
file->details->ctime != ctime) {
if (file->details->thumbnail == NULL) {
file->details->thumbnail_is_up_to_date = FALSE;
}
changed = TRUE;
}
file->details->atime = atime;
......@@ -3424,8 +3428,9 @@ nautilus_file_get_icon (NautilusFile *file,
return icon;
} else if (file->details->thumbnail_path == NULL &&
file->details->can_read &&
!file->details->thumbnailing_failed &&
!file->details->is_thumbnailing) {
!file->details->is_thumbnailing &&
(!file->details->thumbnailing_failed ||
!nautilus_has_valid_failed_thumbnail (file))) {
if (nautilus_can_thumbnail (file)) {
nautilus_create_thumbnail (file);
}
......
......@@ -790,6 +790,22 @@ nautilus_can_thumbnail (NautilusFile *file)
return res;
}
gboolean
nautilus_has_valid_failed_thumbnail (NautilusFile *file)
{
GnomeThumbnailFactory *factory;
char *uri;
gboolean res;
factory = get_thumbnail_factory ();
uri = nautilus_file_get_uri (file);
res = gnome_thumbnail_factory_has_valid_failed_thumbnail (factory, uri, file->details->mtime);
g_free (uri);
return res;
}
void
nautilus_create_thumbnail (NautilusFile *file)
{
......
......@@ -46,6 +46,7 @@ typedef void (* NautilusThumbnailAsyncLoadFunc) (NautilusThumbnailAsyncLoadHandl
/* Returns NULL if there's no thumbnail yet. */
void nautilus_create_thumbnail (NautilusFile *file);
gboolean nautilus_can_thumbnail (NautilusFile *file);
gboolean nautilus_has_valid_failed_thumbnail (NautilusFile *file);
gboolean nautilus_thumbnail_is_mimetype_limited_by_size
(const char *mime_type);
void nautilus_thumbnail_frame_image (GdkPixbuf **pixbuf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment