[Xfce4-commits] <thunar:master> Revert "Instantly emit a change event on the parent folder in the trash job."

Jannis Pohlmann noreply at xfce.org
Fri Nov 19 16:54:01 CET 2010


Updating branch refs/heads/master
         to fd1d1a0c3a230f9f66c00eb49494dbff929db62c (commit)
       from 043c6301aa0285a313db159d5366e66fd77ced0a (commit)

commit fd1d1a0c3a230f9f66c00eb49494dbff929db62c
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Fri Nov 19 16:51:43 2010 +0100

    Revert "Instantly emit a change event on the parent folder in the trash job."
    
    This reverts commit 043c6301aa0285a313db159d5366e66fd77ced0a.
    
    The change introduced a crasher when too many files were trashed at
    once. Too many folder reloads are not good. Perhaps we need
    removed_files closure in addition to the new_files closure.

 thunar/thunar-io-jobs.c |   29 ++++-------------------------
 1 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/thunar/thunar-io-jobs.c b/thunar/thunar-io-jobs.c
index 4799807..6caaa02 100644
--- a/thunar/thunar-io-jobs.c
+++ b/thunar/thunar-io-jobs.c
@@ -657,11 +657,9 @@ _thunar_io_jobs_trash (ThunarJob   *job,
                        GValueArray *param_values,
                        GError     **error)
 {
-  ThunarFile *parent_file;
-  GError     *err = NULL;
-  GFile      *parent;
-  GList      *file_list;
-  GList      *lp;
+  GError *err = NULL;
+  GList  *file_list;
+  GList  *lp;
 
   _thunar_return_val_if_fail (THUNAR_IS_JOB (job), FALSE);
   _thunar_return_val_if_fail (param_values != NULL, FALSE);
@@ -676,26 +674,7 @@ _thunar_io_jobs_trash (ThunarJob   *job,
   for (lp = file_list; err == NULL && lp != NULL; lp = lp->next)
     {
       _thunar_assert (G_IS_FILE (lp->data));
-      
-      if (g_file_trash (lp->data, exo_job_get_cancellable (EXO_JOB (job)), &err))
-        {
-          /* determine the parent folder of the file if there is any */
-          parent = g_file_get_parent (lp->data);
-          if (parent != NULL)
-            {
-              /* obtain the thunar file for this folder from the cache */
-              parent_file = thunar_file_cache_lookup (parent);
-              if (parent_file != NULL)
-                {
-                  /* Feed a change event so that the delete event is 
-                   * picked up immediately */
-                  thunar_file_monitor_file_changed (parent_file);
-                }
-
-              /* release the parent */
-              g_object_unref (parent);
-            }
-        }
+      g_file_trash (lp->data, exo_job_get_cancellable (EXO_JOB (job)), &err);
     }
 
   if (err != NULL)



More information about the Xfce4-commits mailing list