diff options
author | Bradford Hovinen <hovinen@ximian.com> | 2002-04-08 02:42:06 +0000 |
---|---|---|
committer | Bradford Hovinen (Gdict maintainer) <hovinen@src.gnome.org> | 2002-04-08 02:42:06 +0000 |
commit | 72fc255e13804de9eff8f16c008fb82e819f17d5 (patch) | |
tree | 0375cd31d0ce8cfbeec5a00226797f763032c69e | |
parent | b87c01cc34d14e5d17f36d9269b438447060993c (diff) | |
download | gnome-control-center-72fc255e13804de9eff8f16c008fb82e819f17d5.tar.gz |
Don't signal row deleted or reset tmp->next if the child node was not
2002-04-07 Bradford Hovinen <hovinen@ximian.com>
* model-entry.c (model_entry_remove_child): Don't signal row
deleted or reset tmp->next if the child node was not found
-rw-r--r-- | capplets/file-types/ChangeLog | 5 | ||||
-rw-r--r-- | capplets/file-types/model-entry.c | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/capplets/file-types/ChangeLog b/capplets/file-types/ChangeLog index 59f09dec7..fe6f873fe 100644 --- a/capplets/file-types/ChangeLog +++ b/capplets/file-types/ChangeLog @@ -1,3 +1,8 @@ +2002-04-07 Bradford Hovinen <hovinen@ximian.com> + + * model-entry.c (model_entry_remove_child): Don't signal row + deleted or reset tmp->next if the child node was not found + 2002-04-02 jacob berkman <jacob@ximian.com> * service-edit-dialog.c (fill_dialog): show 'unknown' in the diff --git a/capplets/file-types/model-entry.c b/capplets/file-types/model-entry.c index f537f5c84..41db90fc1 100644 --- a/capplets/file-types/model-entry.c +++ b/capplets/file-types/model-entry.c @@ -127,6 +127,7 @@ model_entry_remove_child (ModelEntry *entry, ModelEntry *child, GtkTreeModel *mo ModelEntry *tmp; GtkTreePath *path; GtkTreeIter iter; + gboolean found = TRUE; g_return_if_fail (entry != NULL); g_return_if_fail (entry->type == MODEL_ENTRY_CATEGORY || entry->type == MODEL_ENTRY_SERVICES_CATEGORY || @@ -145,12 +146,18 @@ model_entry_remove_child (ModelEntry *entry, ModelEntry *child, GtkTreeModel *mo entry->first_child = child->next; } else { for (tmp = entry->first_child; tmp->next != NULL && tmp->next != child; tmp = tmp->next); - tmp->next = child->next; + + if (tmp->next != NULL) + tmp->next = child->next; + else + found = FALSE; } child->parent = NULL; - gtk_tree_model_row_deleted (model, path); + if (found) + gtk_tree_model_row_deleted (model, path); + gtk_tree_path_free (path); } |