summaryrefslogtreecommitdiff
path: root/src/nautilus-notebook.c
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-03-03 13:13:25 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-03-03 13:13:25 +0100
commit0d37c7bb0b84da772d20a4e7fca94dd8dd2139fa (patch)
tree197df05c6b7f113109afe32e7b02e423b6685a4e /src/nautilus-notebook.c
parentd616f6b2af648808a06aec977eefb0df74f3d90f (diff)
downloadnautilus-0d37c7bb0b84da772d20a4e7fca94dd8dd2139fa.tar.gz
notebook: avoid updating if no children
We were having a critical when a tab was searching and we closed the window due to the view reporting it's not loading anymore when the notebook already removed the slot. This is due to the slot working independently to the notebook, and the view reporting to stop loading on dispose, which is fine since the view needs to report its new status to the window as well. However the window also update the notebook when is the notebook that removes the slot and therefore dispose the view. To avoid that, check on the window if the notebook still contains the slot or not, and update only in that case.
Diffstat (limited to 'src/nautilus-notebook.c')
-rw-r--r--src/nautilus-notebook.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nautilus-notebook.c b/src/nautilus-notebook.c
index 7d6ca52ac..db66d90ee 100644
--- a/src/nautilus-notebook.c
+++ b/src/nautilus-notebook.c
@@ -188,6 +188,24 @@ nautilus_notebook_init (NautilusNotebook *notebook)
#endif
}
+gboolean
+nautilus_notebook_contains_slot (NautilusNotebook *notebook,
+ NautilusWindowSlot *slot)
+{
+ GList *children;
+ GList *l;
+ gboolean found = FALSE;
+
+ children = gtk_container_get_children (GTK_CONTAINER (notebook));
+ for (l = children; l != NULL && !found; l = l->next) {
+ found = l->data == slot;
+ }
+
+ g_list_free (children);
+
+ return found;
+}
+
void
nautilus_notebook_sync_loading (NautilusNotebook *notebook,
NautilusWindowSlot *slot)