[nautilus] properties-window: don't start deep counts for non-directories



commit 80be708b25973c74fbbf634c85e30376809b0482
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Feb 17 13:51:48 2014 -0800

    properties-window: don't start deep counts for non-directories
    
    Fixes a critical warning when updating the window.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698895

 src/nautilus-properties-window.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index df8d69f..3b15dd9 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -996,6 +996,10 @@ static void
 start_deep_count_for_file (NautilusPropertiesWindow *window,
                           NautilusFile             *file)
 {
+       if (!nautilus_file_is_directory (file)) {
+               return;
+       }
+
        if (!g_list_find (window->details->deep_count_files, file)) {
                nautilus_file_ref (file);
                window->details->deep_count_files = g_list_prepend (window->details->deep_count_files, file);
@@ -2328,9 +2332,7 @@ append_directory_contents_fields (NautilusPropertiesWindow *window,
                NautilusFile *file;
 
                file = NAUTILUS_FILE (l->data);
-               if (nautilus_file_is_directory (file)) {
-                       start_deep_count_for_file (window, file);
-               }
+               start_deep_count_for_file (window, file);
        }
 
        /* Fill in the initial value. */


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