From 98300e06651362af1075dd4bc263b9761b4a8b66 Mon Sep 17 00:00:00 2001 From: Harald Judt <h.judt@gmx.at> Date: Tue, 12 May 2015 14:06:38 +0200 Subject: [PATCH] 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 2d70f522b..217610a0f 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) -- GitLab