[Xfce4-commits] [xfce/thunar] 01/01: Watch for CHANGES_DONE_HINT instead of CHANGED and ATTRIBUTE_CHANGED (bug #8377)

noreply at xfce.org noreply at xfce.org
Tue May 5 19:24:37 CEST 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit a0b81ac84dcfd23f1d310d276e46df13e826fac9
Author: Harald Judt <h.judt at gmx.at>
Date:   Sat May 2 17:40:22 2015 +0200

    Watch for CHANGES_DONE_HINT instead of CHANGED and ATTRIBUTE_CHANGED (bug #8377)
    
    https://developer.gnome.org/gio/unstable/GFileMonitor.html#GFileMonitorEvent:
    G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
    "A hint that this was probably the last change in a set of changes."
    
    Reloading file information can be costly, so it may be wise to only do this
    after a set of changes has been performed, which is not emitted as often
    as the CHANGED and ATTRIBUTE_CHANGED hint.
    
    The G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT will always be emitted after
    G_FILE_MONITOR_EVENT_CHANGED and G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED,
    so wait for it with the reload.
    
    Possible risks: On some (especially remote?) file systems, the EVENT_CHANGED
    and ATTRIBUTE_CHANGED might take a while to be processed, resulting in the
    reload happening later. But then, why would it be faster to reload the
    file before all these changes have been done?
---
 thunar/thunar-file.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 8c32744..58bf9f6 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -661,11 +661,7 @@ thunar_file_monitor_update (GFile             *path,
       switch (event_type)
         {
         case G_FILE_MONITOR_EVENT_CREATED:
-        case G_FILE_MONITOR_EVENT_CHANGED:
-        case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
-          thunar_file_reload (file);
-          break;
-
+        case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
         case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
         case G_FILE_MONITOR_EVENT_DELETED:
           thunar_file_reload (file);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list