# HG changeset patch # User nadvornik # Date 1215116175 0 # Node ID 21e324dcd78c1aba1be8d5082c0574ad392ae6bc # Parent 2d8705f33da574efb386f196fb7fda82bf3ea18f refresh thumbnails on file change diff -r 2d8705f33da5 -r 21e324dcd78c src/main.c --- a/src/main.c Thu Jul 03 19:38:19 2008 +0000 +++ b/src/main.c Thu Jul 03 20:16:15 2008 +0000 @@ -28,6 +28,7 @@ #include "ui_fileops.h" #include "ui_utildlg.h" #include "cache_maint.h" +#include "thumb.h" #include /* for keyboard values */ @@ -689,6 +690,7 @@ /* register global notify functions */ file_data_register_notify_func(cache_notify_cb, NULL, NOTIFY_PRIORITY_HIGH); + file_data_register_notify_func(thumb_notify_cb, NULL, NOTIFY_PRIORITY_HIGH); file_data_register_notify_func(collect_manager_notify_cb, NULL, NOTIFY_PRIORITY_LOW); parse_command_line_for_debug_option(argc, argv); diff -r 2d8705f33da5 -r 21e324dcd78c src/thumb.c --- a/src/thumb.c Thu Jul 03 19:38:19 2008 +0000 +++ b/src/thumb.c Thu Jul 03 20:16:15 2008 +0000 @@ -530,6 +530,18 @@ } #endif + +/* release thumb_pixbuf on file change - this forces reload. */ +void thumb_notify_cb(FileData *fd, NotifyType type, gpointer data) +{ + if (type != NOTIFY_TYPE_INTERNAL && fd->thumb_pixbuf) + { + g_object_unref(fd->thumb_pixbuf); + fd->thumb_pixbuf = NULL; + } +} + + /* *----------------------------------------------------------------------------- * xvpics thumbnail support, read-only (private) diff -r 2d8705f33da5 -r 21e324dcd78c src/thumb.h --- a/src/thumb.h Thu Jul 03 19:38:19 2008 +0000 +++ b/src/thumb.h Thu Jul 03 20:16:15 2008 +0000 @@ -28,5 +28,6 @@ GdkPixbuf *thumb_loader_get_pixbuf(ThumbLoader *tl); +void thumb_notify_cb(FileData *fd, NotifyType type, gpointer data); #endif