From 25c1bb02b1f17f4f2fbffc218070061db55b931b Mon Sep 17 00:00:00 2001 From: Harald Judt Date: Mon, 18 May 2015 20:30:59 +0200 Subject: Alternate version for fixing bug #9513 --- thunar/main.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/thunar/main.c b/thunar/main.c index fc0c91b..bbe2e98 100644 --- a/thunar/main.c +++ b/thunar/main.c @@ -100,6 +100,7 @@ thunar_delayed_exit_check (gpointer user_data) /* unref the trash bin */ if (thunar_trash_file != NULL) { + thunar_file_unwatch (thunar_trash_file); g_object_unref (thunar_trash_file); thunar_trash_file = NULL; } @@ -124,10 +125,6 @@ thunar_force_spawn_trash (void) if (thunar_trash_file != NULL) return; - /* gvfs has no trash support */ - if (!thunar_g_vfs_is_uri_scheme_supported ("trash")) - return; - trash = thunar_g_file_new_for_trash (); thunar_trash_file = thunar_file_cache_lookup (trash); if (thunar_trash_file == NULL) @@ -135,11 +132,9 @@ thunar_force_spawn_trash (void) thunar_trash_file = thunar_file_get (trash, NULL); if (thunar_trash_file) { - /* schedule a few reloads */ - thunar_file_reload_idle (thunar_trash_file); - thunar_file_reload_idle_timeout (thunar_trash_file, 2000); - thunar_file_reload_idle_timeout (thunar_trash_file, 3000); - thunar_file_reload_idle_timeout (thunar_trash_file, 5000); + /* set up a watch and reload the file */ + thunar_file_watch (thunar_trash_file); + thunar_file_reload (thunar_trash_file); } } g_object_unref (trash); @@ -366,6 +361,7 @@ error0: /* unreference the trash file */ if (thunar_trash_file != NULL) { + thunar_file_unwatch (thunar_trash_file); g_object_unref (thunar_trash_file); thunar_trash_file = NULL; } -- 2.4.1