[Xfce4-commits] [xfce/thunar] 01/05: Fix reload when file is replaced with directory of the same name

noreply at xfce.org noreply at xfce.org
Tue May 12 20:52:17 CEST 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit 98300e06651362af1075dd4bc263b9761b4a8b66
Author: Harald Judt <h.judt at gmx.at>
Date:   Tue May 12 14:06:38 2015 +0200

    Fix reload when file is replaced with directory of the same name
    
    This fixes the following issue:
    
    1) open thunar window
    2) touch test
    3) rm test; mkdir test
    
    Expected results:
    The file "test" vanishes from the view, and a directory "test" appears.
    
    Actual results:
    The file "test" does not disappear, and the newly created directory is not shown.
---
 thunar/thunar-folder.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/thunar/thunar-folder.c b/thunar/thunar-folder.c
index 2d70f52..217610a 100644
--- a/thunar/thunar-folder.c
+++ b/thunar/thunar-folder.c
@@ -755,8 +755,18 @@ thunar_folder_monitor (GFileMonitor     *monitor,
         {
           if (event_type == G_FILE_MONITOR_EVENT_DELETED)
             {
+              ThunarFile *destroyed;
+
               /* destroy the file */
               thunar_file_destroy (lp->data);
+
+              /* if the file has not been destroyed by now, reload it to invalidate it */
+              destroyed = thunar_file_cache_lookup (event_file);
+              if (destroyed != NULL)
+                {
+                  thunar_file_reload (destroyed);
+                  g_object_unref (destroyed);
+                }
             }
 
           else if (event_type == G_FILE_MONITOR_EVENT_MOVED)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list