files-view: order unrefing the model so state is clean up

In done_loading we check for floating bar and empty states.
In case the directory doesn't exists anymore in this case,
we cannot do that (without adding bunch of if's).
So instead reorder the unrefing so the directory is alive
when all the checks are performed.
This fixes seeing the floating bar when a directory fails to
load because the user doesn't have permissions.

https://bugzilla.gnome.org/show_bug.cgi?id=755207
This commit is contained in:
Carlos Soriano 2015-10-07 20:29:15 +02:00
parent e2c5c42a20
commit 5bf37b7769

View file

@ -7170,11 +7170,6 @@ nautilus_files_view_stop_loading (NautilusFilesView *view)
{
g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
disconnect_model_handlers (view);
if (view->details->model) {
nautilus_directory_unref (view->details->model);
view->details->model = NULL;
}
unschedule_display_of_pending_files (view);
reset_update_interval (view);
@ -7197,6 +7192,12 @@ nautilus_files_view_stop_loading (NautilusFilesView *view)
view->details->pending_selection = NULL;
done_loading (view, FALSE);
disconnect_model_handlers (view);
if (view->details->model) {
nautilus_directory_unref (view->details->model);
view->details->model = NULL;
}
}
gboolean