[nautilus] files-view: use explicit in_destruction boolean
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] files-view: use explicit in_destruction boolean
- Date: Fri, 15 Jan 2016 17:05:02 +0000 (UTC)
commit 7d45760ccbcf1b5110e6a37be3c851c7f04c6d60
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Jan 13 19:05:54 2016 +0100
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
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 1b9243b..06bd73b 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"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]