mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
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
This commit is contained in:
parent
90cb6baa9c
commit
41a08e5682
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue