From 045b964356b60e39fbe90d3ffc21d7abf6707146 Mon Sep 17 00:00:00 2001
From: Nick Schermer <nick@xfce.org>
Date: Thu, 1 Nov 2012 21:17:16 +0100
Subject: [PATCH] Also clear cache on reload of a file.

---
 thunar/thunar-file.c         | 4 ++++
 thunar/thunar-icon-factory.c | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 3187c8594..0dd11cd58 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -66,6 +66,7 @@
 #include <thunar/thunar-user.h>
 #include <thunar/thunar-util.h>
 #include <thunar/thunar-dialogs.h>
+#include <thunar/thunar-icon-factory.h>
 
 
 
@@ -3456,6 +3457,9 @@ thunar_file_reload (ThunarFile *file)
 {
   _thunar_return_if_fail (THUNAR_IS_FILE (file));
 
+  /* clear file pxmap cache */
+  thunar_icon_factory_clear_pixmap_cache (file);
+
   if (!thunar_file_load (file, NULL, NULL))
     {
       /* destroy the file if we cannot query any file information */
diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c
index 2f66ce9fb..2826e228e 100644
--- a/thunar/thunar-icon-factory.c
+++ b/thunar/thunar-icon-factory.c
@@ -879,5 +879,6 @@ thunar_icon_factory_clear_pixmap_cache (ThunarFile *file)
   _thunar_return_if_fail (THUNAR_IS_FILE (file));
 
   /* unset the data */
-  g_object_set_qdata (G_OBJECT (file), thunar_icon_factory_store_quark, NULL);
+  if (thunar_icon_factory_store_quark != 0)
+    g_object_set_qdata (G_OBJECT (file), thunar_icon_factory_store_quark, NULL);
 }
-- 
GitLab