[Xfce4-commits] <thunar:nick/new-shortcuts-pane-model> Reload just-mounted files before creating a folder.
Nick Schermer
noreply at xfce.org
Sun Oct 7 13:48:04 CEST 2012
Updating branch refs/heads/nick/new-shortcuts-pane-model
to c9ef76cfa2525aafd3ccabd1c23b9eea74d8f15d (commit)
from b5e03784ced970b49790a54cbac3cedc40d46846 (commit)
commit c9ef76cfa2525aafd3ccabd1c23b9eea74d8f15d
Author: Nick Schermer <nick at xfce.org>
Date: Sun Oct 7 12:53:45 2012 +0200
Reload just-mounted files before creating a folder.
This can happend when entering a remote filesystem. The
info is not loaded yet (so thunar_file_is_directory) fails.
thunar/thunar-folder.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/thunar/thunar-folder.c b/thunar/thunar-folder.c
index 8dc051c..d50076d 100644
--- a/thunar/thunar-folder.c
+++ b/thunar/thunar-folder.c
@@ -706,8 +706,19 @@ thunar_folder_get_for_file (ThunarFile *file)
ThunarFolder *folder;
_thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL);
+
+ /* make sure the folder is mounted, this happens when a
+ * mount is entered for the first time */
+ if (thunar_file_get_info (file) == NULL
+ && !thunar_file_is_mounted (file))
+ thunar_file_reload (file);
+
_thunar_return_val_if_fail (thunar_file_is_directory (file), NULL);
+ /* load if the file is not a folder */
+ if (!thunar_file_is_directory (file))
+ return NULL;
+
/* determine the "thunar-folder" quark on-demand */
if (G_UNLIKELY (thunar_folder_quark == 0))
thunar_folder_quark = g_quark_from_static_string ("thunar-folder");
More information about the Xfce4-commits
mailing list