Commit 3354ae58 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

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
parent 018f7747
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)
2008-01-14 Alexander Larsson <alexl@redhat.com>
* configure.in:
......
......@@ -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);
......
......@@ -105,6 +105,7 @@ struct NautilusFileDetails
char *thumbnail_path;
GdkPixbuf *thumbnail;
time_t thumbnail_mtime;
int thumbnail_size; /* 0 means original unframed thumbnail */
GList *mime_list; /* If this is a directory, the list of MIME types in it. */
......
......@@ -1708,6 +1708,13 @@ update_info_internal (NautilusFile *file,
file->details->ctime = ctime;
file->details->mtime = mtime;
if (file->details->thumbnail != NULL &&
file->details->thumbnail_mtime != 0 &&
file->details->thumbnail_mtime != mtime) {
file->details->thumbnail_is_up_to_date = FALSE;
changed = TRUE;
}
icon = g_file_info_get_icon (info);
if (!g_icon_equal (icon, file->details->icon)) {
changed = TRUE;
......
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