From 1ba22c9da3222265d328b4049e4d854cebdc6ff0 Mon Sep 17 00:00:00 2001 From: Harald Judt Date: Wed, 25 Mar 2015 15:19:56 +0100 Subject: Add function to reload parent file of a file --- thunar/thunar-file.c | 26 ++++++++++++++++++++++++++ thunar/thunar-file.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index b3a66e4..41fe230 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -734,6 +734,32 @@ thunar_file_monitor_moved (ThunarFile *file, +void +thunar_file_reload_parent (ThunarFile *file) +{ + ThunarFile *parent; + + _thunar_return_if_fail (THUNAR_IS_FILE (file)); + + if (thunar_file_has_parent (file)) + { + GFile *parent_file; + + /* only reload file if it is in cache */ + parent_file = g_file_get_parent (file->gfile); + parent = thunar_file_cache_lookup (parent_file); + g_object_unref (parent_file); + } + + if (parent) + { + thunar_file_reload (parent); + g_object_unref (parent); + } +} + + + static void thunar_file_monitor (GFileMonitor *monitor, GFile *path, diff --git a/thunar/thunar-file.h b/thunar/thunar-file.h index f0302e3..c645330 100644 --- a/thunar/thunar-file.h +++ b/thunar/thunar-file.h @@ -241,6 +241,8 @@ void thunar_file_unwatch (ThunarFile void thunar_file_reload (ThunarFile *file); +void thunar_file_reload_parent (ThunarFile *file); + void thunar_file_destroy (ThunarFile *file); -- 2.3.3