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
This commit is contained in:
Bradford Hovinen 2002-04-08 02:42:06 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent b87c01cc34
commit 72fc255e13
2 changed files with 14 additions and 2 deletions

View file

@ -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

View file

@ -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);
}