diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-01-13 19:05:54 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-01-15 18:03:14 +0100 |
commit | 7d45760ccbcf1b5110e6a37be3c851c7f04c6d60 (patch) | |
tree | 2c614c1eb1c9967d65d9bad15028eb32de64e416 | |
parent | 4d94a88848d1daca37b92767074e9afe8df7cf7d (diff) | |
download | nautilus-7d45760ccbcf1b5110e6a37be3c851c7f04c6d60.tar.gz |
files-view: use explicit in_destruction boolean
So we were relying on the model to be NULL to not update all
the view widgets and details in the done_loading callback.
However, we need the model alive so in the signal of is-loading
emitted on the done_loading function, external objects can peek
the model, etc. even in destruction time.
So instead of setting the model as NULL on destroy and relying on it,
use a explicit boolean to not update view widgets on destroy.
https://bugzilla.gnome.org/show_bug.cgi?id=759717
-rw-r--r-- | src/nautilus-files-view.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 1b9243bed..06bd73b39 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -229,6 +229,8 @@ struct NautilusFilesViewDetails gboolean templates_present; gboolean scripts_present; + gboolean in_destruction; + gboolean sort_directories_first; gboolean show_foreign_files; @@ -2855,6 +2857,7 @@ nautilus_files_view_destroy (GtkWidget *object) view = NAUTILUS_FILES_VIEW (object); + view->details->in_destruction = TRUE; nautilus_files_view_stop_loading (view); for (node = view->details->scripts_directory_list; node != NULL; node = next) { @@ -3174,9 +3177,7 @@ done_loading (NautilusFilesView *view, nautilus_profile_start (NULL); - /* This can be called during destruction, in which case we set the model - * as NULL. */ - if (view->details->model != NULL) { + if (!view->details->in_destruction) { nautilus_files_view_update_toolbar_menus (view); remove_loading_floating_bar (view); schedule_update_context_menus (view); @@ -8228,6 +8229,8 @@ nautilus_files_view_init (NautilusFilesView *view) "changed::" NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE, G_CALLBACK (schedule_update_context_menus), view); + view->details->in_destruction = FALSE; + /* Accessibility */ atk_object = gtk_widget_get_accessible (GTK_WIDGET (view)); atk_object_set_name (atk_object, _("Content View")); |