[Xfce4-commits] <thunar:master> Reload just-mounted files before creating a folder.

Nick Schermer noreply at xfce.org
Sat Oct 13 16:12:25 CEST 2012


Updating branch refs/heads/master
         to 67578cbf9caead21d9fe137ba25862fe39455ef7 (commit)
       from 19e3e68ac917c00cbe83fa0451192aeacb3b4944 (commit)

commit 67578cbf9caead21d9fe137ba25862fe39455ef7
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