diff src/view_file_list.c @ 1506:d352a44545a6

Force thumbnails refreshing when thumbnails dimensions are modified through Preferences.
author zas_
date Thu, 02 Apr 2009 23:11:07 +0000
parents 331e2d60d447
children 24a12aa0cb54
line wrap: on
line diff
--- a/src/view_file_list.c	Thu Apr 02 16:10:12 2009 +0000
+++ b/src/view_file_list.c	Thu Apr 02 23:11:07 2009 +0000
@@ -1126,15 +1126,18 @@
 		GtkTreeModel *store;
 		GtkTreeIter iter;
 		gboolean valid = TRUE;
-
+	
 		store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));
 		gtk_tree_model_get_iter(store, &iter, tpath);
 		gtk_tree_path_free(tpath);
 
 		while (!fd && valid && tree_view_row_get_visibility(GTK_TREE_VIEW(vf->listview), &iter, FALSE) == 0)
 			{
-			gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &fd, -1);
-			if (fd->thumb_pixbuf) fd = NULL;
+			FileData *nfd;
+
+			gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &nfd, -1);
+
+			if (!nfd->thumb_pixbuf) fd = nfd;
 
 			valid = gtk_tree_model_iter_next(store, &iter);
 			}
@@ -1195,7 +1198,7 @@
 	return FALSE;
 }
 
-static void vflist_thumb_update(ViewFile *vf)
+void vflist_thumb_update(ViewFile *vf)
 {
 	vflist_thumb_stop(vf);
 	if (!VFLIST(vf)->thumbs_enabled) return;
@@ -1203,6 +1206,23 @@
 	vflist_thumb_status(vf, 0.0, _("Loading thumbs..."));
 	vf->thumbs_running = TRUE;
 
+	if (thumb_format_changed)
+		{
+		GList *work = vf->list;
+		while (work)
+			{
+			FileData *fd = work->data;
+			if (fd->thumb_pixbuf)
+				{
+				g_object_unref(fd->thumb_pixbuf);
+				fd->thumb_pixbuf = NULL;
+				}
+			work = work->next;
+			}
+
+		thumb_format_changed = FALSE;
+		}
+
 	while (vflist_thumb_next(vf));
 }