[Nautilus-list] [PATCH]: Avoid directory reload when FAM is active.



Hi,

here is the requested patch that will avoid directory 
reloading if FAM is active.

Can I commit ?

Index: src/nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.266
diff -u -p -r1.266 nautilus-window-manage-views.c
--- src/nautilus-window-manage-views.c	2001/06/02 19:39:16	1.266
+++ src/nautilus-window-manage-views.c	2001/06/17 12:10:53
@@ -57,6 +57,7 @@
 #include <libnautilus-private/nautilus-metadata.h>
 #include <libnautilus-private/nautilus-mime-actions.h>
 #include <libnautilus-private/nautilus-search-uri.h>
+#include <libnautilus-private/nautilus-monitor.h>
 
 /* FIXME bugzilla.eazel.com 1243: 
  * We should use inheritance instead of these special cases
@@ -1366,8 +1367,9 @@ begin_location_change (NautilusWindow *w
                        NautilusLocationChangeType type,
                        guint distance)
 {
-        NautilusDirectory *directory;
         NautilusFile *file;
+        gboolean use_monitoring;
+        NautilusDirectory *directory;
 
         g_assert (NAUTILUS_IS_WINDOW (window));
         g_assert (location != NULL);
@@ -1384,13 +1386,20 @@ begin_location_change (NautilusWindow *w
         window->details->location_change_distance = distance;
 
         directory = nautilus_directory_get (location);
-
-        /* In all 4 cases, we want fresh information. */
-        nautilus_directory_force_reload (directory);
-        file = nautilus_directory_get_corresponding_file (directory);
-        nautilus_file_invalidate_all_attributes (file);
-        nautilus_file_unref (file);
 
+        /*
+         * If FAM is not active,
+         * reload the directory to avoid missing anything new.
+         */
+        use_monitoring = nautilus_monitor_active ();
+        if ( ! use_monitoring ) {
+                /* In all 4 cases, we want fresh information. */
+                nautilus_directory_force_reload (directory);
+                file = nautilus_directory_get_corresponding_file (directory);
+                nautilus_file_invalidate_all_attributes (file);
+                nautilus_file_unref (file);
+        }
+        
         window->details->determine_view_handle = nautilus_determine_initial_view
                 (location,
                  determined_initial_view_callback,


-- 
Yoann Vandoorselaere | C makes it easy to shoot yourself in the foot. C++ makes
MandrakeSoft         | it harder, but when you do, it blows away your whole
                     | leg. - Bjarne Stroustrup




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]