From 884a296a12b0a05242668802e7f3d9c37151a8c0 Mon Sep 17 00:00:00 2001 From: Alexandru Pandelea Date: Wed, 2 Aug 2017 10:27:10 +0100 Subject: 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 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index de11c059b..d8d4326f7 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); } -- cgit v1.2.1