diff options
author | Nick Schermer <nick@xfce.org> | 2012-10-07 12:53:45 +0200 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2012-10-13 16:10:35 +0200 |
commit | 67578cbf9caead21d9fe137ba25862fe39455ef7 (patch) | |
tree | a1a36d69cb4fba27203e408d09068fcb1d5805c0 | |
parent | 19e3e68ac917c00cbe83fa0451192aeacb3b4944 (diff) | |
download | thunar-67578cbf9caead21d9fe137ba25862fe39455ef7.tar.gz |
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.
-rw-r--r-- | 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 8dc051cf..d50076d4 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"); |