From e3b65ff628499248dadfe7cbdb027e17b7db03c2 Mon Sep 17 00:00:00 2001
From: Harald Judt <h.judt@gmx.at>
Date: Mon, 18 May 2015 21:41:26 +0200
Subject: [PATCH] Revert "Fix loading the trash bin status at startup (bug
 #9513)"

This reverts commit 2d5567b2f6ae6223c8865547704797a5c785ec1f.
---
 thunar/main.c        | 56 +-------------------------------------------
 thunar/thunar-file.c | 21 -----------------
 thunar/thunar-file.h |  2 --
 3 files changed, 1 insertion(+), 78 deletions(-)

diff --git a/thunar/main.c b/thunar/main.c
index fc0c91b01..e2eff3eda 100644
--- a/thunar/main.c
+++ b/thunar/main.c
@@ -53,7 +53,7 @@ static gboolean opt_daemon = FALSE;
 static gchar   *opt_sm_client_id = NULL;
 static gboolean opt_quit = FALSE;
 static gboolean opt_version = FALSE;
-static ThunarFile *thunar_trash_file = NULL;
+
 
 
 /* --- command line options --- */
@@ -97,13 +97,6 @@ thunar_delayed_exit_check (gpointer user_data)
     }
   else
     {
-      /* unref the trash bin */
-      if (thunar_trash_file != NULL)
-        {
-          g_object_unref (thunar_trash_file);
-          thunar_trash_file = NULL;
-        }
-
       /* no command line arguments opened in Thunar, exit now */
       gtk_main_quit ();
 
@@ -115,38 +108,6 @@ thunar_delayed_exit_check (gpointer user_data)
 
 
 
-static void
-thunar_force_spawn_trash (void)
-{
-  GFile      *trash;
-
-  /* check that this has not happened yet */
-  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)
-    {
-      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);
-        }
-    }
-  g_object_unref (trash);
-}
-
-
-
 int
 main (int argc, char **argv)
 {
@@ -290,14 +251,6 @@ main (int argc, char **argv)
   /* initialize the thunar stock items/icons */
   thunar_stock_init ();
 
-  /* For the trash state to be correct, gvfsd-trash needs to have been
-   * spawned. If the trash file is not in cache, this means we could
-   * access it the first time and the daemon might not have been
-   * spawned yet. So let's reload the trash later in idle, so that
-   * the state gets updated correctly (bug #9513).
-   */
-  thunar_force_spawn_trash ();
-
   /* acquire a reference on the global application */
   application = thunar_application_get ();
 
@@ -363,13 +316,6 @@ error0:
     g_object_unref (G_OBJECT (dbus_service));
 #endif
 
-  /* unreference the trash file */
-  if (thunar_trash_file != NULL)
-    {
-      g_object_unref (thunar_trash_file);
-      thunar_trash_file = NULL;
-    }
-
   /* disconnect from the session manager */
   g_object_unref (G_OBJECT (session_client));
 
diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 4ab921fbf..44c12132c 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -3951,27 +3951,6 @@ thunar_file_reload_idle (ThunarFile *file)
 
 
 
-/**
- * thunar_file_reload_idle_timeout:
- * @file    : a #ThunarFile instance.
- * @timeout : the timeout in ms after which the reload should happen
- *
- * Schedules a reload of the @file by calling thunar_file_reload in
- * idle after @timeout milliseconds have passed.
- *
- **/
-void
-thunar_file_reload_idle_timeout (ThunarFile *file,
-                                 guint timeout)
-{
-  _thunar_return_if_fail (THUNAR_IS_FILE (file));
-
-  g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, timeout,
-                      (GSourceFunc) thunar_file_reload, file, NULL);
-}
-
-
-
 /**
  * thunar_file_destroy:
  * @file : a #ThunarFile instance.
diff --git a/thunar/thunar-file.h b/thunar/thunar-file.h
index 1704aca50..9a3de1782 100644
--- a/thunar/thunar-file.h
+++ b/thunar/thunar-file.h
@@ -241,8 +241,6 @@ void              thunar_file_unwatch                    (ThunarFile
 
 void              thunar_file_reload                     (ThunarFile              *file);
 void              thunar_file_reload_idle                (ThunarFile              *file);
-void              thunar_file_reload_idle_timeout        (ThunarFile              *file,
-                                                          guint                    timeout);
 void              thunar_file_reload_parent              (ThunarFile              *file);
 
 void              thunar_file_destroy                    (ThunarFile              *file);
-- 
GitLab