diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 2478d7e..32104a2 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -1283,20 +1283,6 @@ thunar_standard_view_set_loading (ThunarStandardView *standard_view, g_object_unref (G_OBJECT (file)); } - /* check if we have a path list from new_files pending */ - if (G_UNLIKELY (!loading && standard_view->priv->new_files_path_list != NULL)) - { - /* remember and reset the new_files_path_list */ - new_files_path_list = standard_view->priv->new_files_path_list; - standard_view->priv->new_files_path_list = NULL; - - /* and try again */ - thunar_standard_view_new_files (standard_view, new_files_path_list); - - /* cleanup */ - thunar_g_file_list_free (new_files_path_list); - } - /* check if we're done loading */ if (!loading) { @@ -1304,8 +1290,24 @@ thunar_standard_view_set_loading (ThunarStandardView *standard_view, selected_files = standard_view->priv->selected_files; standard_view->priv->selected_files = NULL; - /* and try setting the selected files again */ - thunar_component_set_selected_files (THUNAR_COMPONENT (standard_view), selected_files); + /* if we have new files pending for selection, select them */ + if (standard_view->priv->new_files_path_list != NULL) + { + /* remember and reset the new_files_path_list */ + new_files_path_list = standard_view->priv->new_files_path_list; + standard_view->priv->new_files_path_list = NULL; + + /* and try again */ + thunar_standard_view_new_files (standard_view, new_files_path_list); + + /* cleanup */ + thunar_g_file_list_free (new_files_path_list); + } + else + { + /* and try setting the selected files again */ + thunar_component_set_selected_files (THUNAR_COMPONENT (standard_view), selected_files); + } /* cleanup */ thunar_file_list_free (selected_files); @@ -2394,7 +2396,9 @@ thunar_standard_view_new_files (ThunarStandardView *standard_view, } else if (G_LIKELY (path_list != NULL)) { - /* determine the files for the paths */ + /* determine the files for the paths. + * The new files should be in the cache because ThunarJob's make ThunarFolder's + * reload as they add/remove files */ for (lp = path_list; lp != NULL; lp = lp->next) { file = thunar_file_cache_lookup (lp->data); @@ -2414,9 +2418,6 @@ thunar_standard_view_new_files (ThunarStandardView *standard_view, /* grab the focus to the view widget */ gtk_widget_grab_focus (GTK_BIN (standard_view)->child); } - - /* manually reload the folder to avoid a delay */ - thunar_standard_view_reload (THUNAR_VIEW (standard_view)); } }