[nautilus] files-view: fix adding files to the view



commit 884a296a12b0a05242668802e7f3d9c37151a8c0
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date:   Wed Aug 2 10:27:10 2017 +0100

    files-view: fix adding files to the view
    
    Searching makes Nautilus have no files in the view sometimes, even
    if there are search results, because the view connects to the
    files-added signal after it added a monitor to the directory
    and the signal might be emitted before connecting to it.
    
    To fix this, first connect to the files-added and files-changed
    signals, before adding the monitor to the directory.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785722

 src/nautilus-files-view.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index de11c05..d8d4326 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -8457,12 +8457,6 @@ finish_loading (NautilusFilesView *view)
         NAUTILUS_FILE_ATTRIBUTE_MOUNT |
         NAUTILUS_FILE_ATTRIBUTE_EXTENSION_INFO;
 
-    nautilus_directory_file_monitor_add (priv->model,
-                                         &priv->model,
-                                         priv->show_hidden_files,
-                                         attributes,
-                                         files_added_callback, view);
-
     priv->files_added_handler_id = g_signal_connect
                                                 (priv->model, "files-added",
                                                 G_CALLBACK (files_added_callback), view);
@@ -8470,6 +8464,12 @@ finish_loading (NautilusFilesView *view)
                                                   (priv->model, "files-changed",
                                                   G_CALLBACK (files_changed_callback), view);
 
+    nautilus_directory_file_monitor_add (priv->model,
+                                         &priv->model,
+                                         priv->show_hidden_files,
+                                         attributes,
+                                         files_added_callback, view);
+
     nautilus_profile_end (NULL);
 }
 


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