diff options
author | Alexander Larsson <alexl@redhat.com> | 2008-01-15 14:10:20 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2008-01-15 14:10:20 +0000 |
commit | 3354ae583101f262e7dd602a8212bd56eb489ab8 (patch) | |
tree | cb6fb2fa133d02a8b8a8916bf6eda57efa153000 /libnautilus-private/nautilus-directory-async.c | |
parent | 018f77471e0b77a3bc5302b7fd54ccbca02dd528 (diff) | |
download | nautilus-3354ae583101f262e7dd602a8212bd56eb489ab8.tar.gz |
Honor mtime specified in thumbnail (#504833)
2008-01-15 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory-async.c:
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file.c:
Honor mtime specified in thumbnail (#504833)
svn path=/trunk/; revision=13606
Diffstat (limited to 'libnautilus-private/nautilus-directory-async.c')
-rw-r--r-- | libnautilus-private/nautilus-directory-async.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c index 807310d3a..828baf9c4 100644 --- a/libnautilus-private/nautilus-directory-async.c +++ b/libnautilus-private/nautilus-directory-async.c @@ -3583,6 +3583,9 @@ thumbnail_done (NautilusDirectory *directory, GdkPixbuf *pixbuf, gboolean tried_original) { + const char *thumb_mtime_str; + time_t thumb_mtime; + file->details->thumbnail_is_up_to_date = TRUE; file->details->thumbnail_tried_original = tried_original; if (file->details->thumbnail) { @@ -3591,7 +3594,17 @@ thumbnail_done (NautilusDirectory *directory, } file->details->thumbnail_size = 0; if (pixbuf) { - file->details->thumbnail = g_object_ref (pixbuf); + thumb_mtime_str = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::MTime"); + thumb_mtime = atol (thumb_mtime_str); + + if (thumb_mtime == 0 || + thumb_mtime == file->details->mtime) { + file->details->thumbnail = g_object_ref (pixbuf); + file->details->thumbnail_mtime = thumb_mtime; + } else { + g_free (file->details->thumbnail_path); + file->details->thumbnail_path = NULL; + } } nautilus_directory_async_state_changed (directory); |