Some optional debugging statements. (nautilus_tree_model_monitor_remove):

* components/tree/nautilus-tree-model.c
	(nautilus_tree_model_for_each_postorder): Some optional debugging
	statements.
	(nautilus_tree_model_monitor_remove): Also unmonitor any nodes
	that might be monitored by this client.

	* components/tree/nautilus-tree-view.c
	(nautilus_tree_view_destroy): Stop monitoring the model
This commit is contained in:
Maciej Stachowiak 2000-09-03 21:33:07 +00:00
parent 6653e9ac90
commit cafec356c0
3 changed files with 48 additions and 7 deletions

View file

@ -1,3 +1,14 @@
2000-09-03 Maciej Stachowiak <mjs@eazel.com>
* components/tree/nautilus-tree-model.c
(nautilus_tree_model_for_each_postorder): Some optional debugging
statements.
(nautilus_tree_model_monitor_remove): Also unmonitor any nodes
that might be monitored by this client.
* components/tree/nautilus-tree-view.c
(nautilus_tree_view_destroy): Stop monitoring the model
2000-09-03 Ali Abdin <aliabdin@aucegypt.edu>
I now consider navigation links to be 'done' (Fixes bug #2201)

View file

@ -66,7 +66,7 @@ NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusTreeModel, nautilus_tree_model, GTK_T
static void remove_all_nodes (NautilusTreeModel *model);
static void remove_all_nodes (NautilusTreeModel *model);
static void nautilus_tree_model_set_root_uri (NautilusTreeModel *model,
const char *root_uri);
@ -240,12 +240,33 @@ nautilus_tree_model_for_each_postorder (NautilusTreeModel *model,
current_node = (NautilusTreeNode *) reporting_queue->data;
if (nautilus_tree_node_get_children (current_node) == NULL) {
NautilusDirectory *tmp;
reporting_queue = g_list_remove_link (reporting_queue, reporting_queue);
#ifdef DEBUG_TREE
printf ("XXX unrefing: %s\n", nautilus_file_get_uri
(nautilus_tree_node_get_file (current_node)));
#endif
tmp = current_node->details->directory;
(*callback) (model, current_node, callback_data);
#ifdef DEBUG_TREE
printf ("XXX refs: %d\n", ((GtkObject *) tmp)->ref_count);
#endif
} else {
#ifdef DEBUG_TREE
printf ("XXX adding children of: %s\n", nautilus_file_get_uri
(nautilus_tree_node_get_file (current_node)));
#endif
reporting_queue = g_list_concat (g_list_copy (nautilus_tree_node_get_children (current_node)),
reporting_queue);
}
#ifdef DEBUG_TREE
printf ("XXX queue length: %d\n", g_list_length (reporting_queue));
#endif
}
}
}
@ -329,9 +350,22 @@ nautilus_tree_model_monitor_remove (NautilusTreeModel *model,
{
model->details->monitor_clients = g_list_remove (model->details->monitor_clients, (gpointer) client);
if (model->details->root_node_reported) {
nautilus_tree_model_stop_monitoring_node_recursive (model,
model->details->root_node,
client);
}
if (model->details->monitor_clients == NULL) {
/* FIXME bugzilla.eazel.com 2412:
* stop monitoring root node file, dunno what else */
if (model->details->root_node_reported) {
nautilus_file_monitor_remove (nautilus_tree_node_get_file
(model->details->root_node),
model);
}
}
}

View file

@ -945,9 +945,7 @@ disconnect_model_handlers (NautilusTreeView *view)
"file:///");
if (node != NULL) {
nautilus_tree_model_stop_monitoring_node_recursive (view->details->model,
node,
view);
nautilus_tree_model_monitor_remove (view->details->model, view);
}
}
@ -967,13 +965,11 @@ nautilus_tree_view_destroy (GtkObject *object)
/* FIXME bugzilla.eazel.com 2422: destroy drag_info */
disconnect_model_handlers (view);
gtk_object_unref (GTK_OBJECT (view->details->model));
nautilus_tree_expansion_state_save (view->details->expansion_state);
gtk_object_unref (GTK_OBJECT (view->details->expansion_state));
gtk_object_unref (GTK_OBJECT (view->details->model));
g_free (view->details);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));