From ee69787f7d5a001b3d7a91173e5f7b496d4a5ae1 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Sun, 27 Jan 2002 16:30:07 +0000 Subject: [PATCH] Set the parent field (model_entry_remove_child): Reset the parent field 2002-01-27 Bradford Hovinen * 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 --- capplets/file-types/ChangeLog | 5 +++++ capplets/file-types/model-entry.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/capplets/file-types/ChangeLog b/capplets/file-types/ChangeLog index f143f911d..ad8acb2cd 100644 --- a/capplets/file-types/ChangeLog +++ b/capplets/file-types/ChangeLog @@ -1,5 +1,10 @@ 2002-01-27 Bradford Hovinen + * 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 diff --git a/capplets/file-types/model-entry.c b/capplets/file-types/model-entry.c index 06ebc2e31..5580092d6 100644 --- a/capplets/file-types/model-entry.c +++ b/capplets/file-types/model-entry.c @@ -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); }