changeset 2520:2f88376d1cf2

Ensure .sim files are cleared from cache If file filtering was enabled, the .sim files were not cleared from the geeqie cache
author Colin Clark <colin.clark@cclark.uk>
date Fri, 07 Jul 2017 12:11:56 +0100
parents 4d1bf123eeed
children b66e00ca9ba9
files src/cache_maint.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/cache_maint.c	Thu Jul 06 14:47:45 2017 +0100
+++ b/src/cache_maint.c	Fri Jul 07 12:11:56 2017 +0100
@@ -138,6 +138,7 @@
 	gboolean still_have_a_file = TRUE;
 	gsize base_length;
 	const gchar *cache_folder;
+	gboolean filter_disable;
 
 	if (cm->metadata)
 		{
@@ -162,6 +163,13 @@
 
 	DEBUG_1("purge chk (%d) \"%s\"", (cm->clear && !cm->metadata), fd->path);
 
+/**
+ * It is necessary to disable the file filter when clearing the cache,
+ * otherwise the .sim (file similarity) files are not deleted.
+ */
+	filter_disable = options->file_filter.disable;
+	options->file_filter.disable = TRUE;
+
 	if (g_list_find(cm->done_list, fd) == NULL)
 		{
 		cm->done_list = g_list_prepend(cm->done_list, fd);
@@ -198,6 +206,8 @@
 				}
 			}
 		}
+	options->file_filter.disable = filter_disable;
+
 	filelist_free(list);
 
 	cm->list = g_list_concat(dlist, cm->list);
@@ -1222,7 +1232,7 @@
 	button = pref_table_button(table, 0, 1, GTK_STOCK_DELETE, _("Clear cache"), FALSE,
 				   G_CALLBACK(cache_manager_main_clear_cb), cache_manager);
 	gtk_size_group_add_widget(sizegroup, button);
-	pref_table_label(table, 1, 1, _("Delete all cached thumbnails."), 0.0);
+	pref_table_label(table, 1, 1, _("Delete all cached data."), 0.0);
 
 
 	group = pref_group_new(gd->vbox, FALSE, _("Shared thumbnail cache"), GTK_ORIENTATION_VERTICAL);