Set the parent field (model_entry_remove_child): Reset the parent field

2002-01-27  Bradford Hovinen  <hovinen@ximian.com>

	* model-entry.c (model_entry_insert_child): Set the parent field
	(model_entry_remove_child): Reset the parent field
	(model_entry_remove_child): Set up the path before removing the
	entry from the list
This commit is contained in:
Bradford Hovinen 2002-01-27 16:30:07 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 6a3797bfc5
commit ee69787f7d
2 changed files with 12 additions and 2 deletions

View file

@ -1,5 +1,10 @@
2002-01-27 Bradford Hovinen <hovinen@ximian.com>
* model-entry.c (model_entry_insert_child): Set the parent field
(model_entry_remove_child): Reset the parent field
(model_entry_remove_child): Set up the path before removing the
entry from the list
* service-info.c (load_all_services): Accept model
(get_services_category_entry): Accept model
(service_info_new): Accept model

View file

@ -113,6 +113,8 @@ model_entry_insert_child (ModelEntry *entry, ModelEntry *child, GtkTreeModel *mo
tmp->next = child;
}
child->parent = entry;
mime_types_model_construct_iter (MIME_TYPES_MODEL (model), child, &iter);
path = gtk_tree_model_get_path (model, &iter);
gtk_tree_model_row_inserted (model, path, &iter);
@ -133,6 +135,9 @@ model_entry_remove_child (ModelEntry *entry, ModelEntry *child, GtkTreeModel *mo
g_return_if_fail (model != NULL);
g_return_if_fail (IS_MIME_TYPES_MODEL (model));
mime_types_model_construct_iter (MIME_TYPES_MODEL (model), child, &iter);
path = gtk_tree_model_get_path (model, &iter);
if (entry->first_child == NULL) {
return;
}
@ -143,8 +148,8 @@ model_entry_remove_child (ModelEntry *entry, ModelEntry *child, GtkTreeModel *mo
tmp->next = child->next;
}
mime_types_model_construct_iter (MIME_TYPES_MODEL (model), child, &iter);
path = gtk_tree_model_get_path (model, &iter);
child->parent = NULL;
gtk_tree_model_row_deleted (model, path);
gtk_tree_path_free (path);
}