[Xfce4-commits] <thunar:master> If file thumbnail is known, remove it.

Nick Schermer noreply at xfce.org
Tue Oct 30 22:06:07 CET 2012


Updating branch refs/heads/master
         to 42118955ae58b425c41037bf59b0f82708e76880 (commit)
       from 6d2a991f54cb09666b6153d9e25546d7c0434fb1 (commit)

commit 42118955ae58b425c41037bf59b0f82708e76880
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Oct 30 20:11:10 2012 +0100

    If file thumbnail is known, remove it.

 thunar/thunar-file.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index a4e5967..4f2d12e 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -3135,6 +3135,10 @@ thunar_file_get_thumbnail_path (ThunarFile *file)
 
   _thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL);
 
+  /* if the thumbstate is known to be not there, return null */
+  if (thunar_file_get_thumb_state (file) == THUNAR_FILE_THUMB_STATE_NONE)
+    return NULL;
+
   if (G_UNLIKELY (file->thumbnail_path == NULL))
     {
       checksum = g_checksum_new (G_CHECKSUM_MD5);
@@ -3199,6 +3203,14 @@ thunar_file_set_thumb_state (ThunarFile          *file,
   /* set the new thumbnail state */
   file->flags = (file->flags & ~THUNAR_FILE_THUMB_STATE_MASK) | (state);
 
+  /* remove path if the type is not supported */
+  if (state == THUNAR_FILE_THUMB_STATE_NONE
+      && file->thumbnail_path != NULL)
+    {
+      g_free (file->thumbnail_path);
+      file->thumbnail_path = NULL;
+    }
+
   /* notify others of this change, so that all components can update
    * their file information. loading is only a state for the thumbnailer,
    * so don't emit changes for that */


More information about the Xfce4-commits mailing list