summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-08-02 10:27:10 +0100
committerAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-08-07 12:02:10 +0100
commit884a296a12b0a05242668802e7f3d9c37151a8c0 (patch)
treec00d50532e27b441622ba75a4d274a460523fcb6
parente5d98fee7026a9304cc232402be09f8082e01b8f (diff)
downloadnautilus-884a296a12b0a05242668802e7f3d9c37151a8c0.tar.gz
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
-rw-r--r--src/nautilus-files-view.c12
1 files 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);
}