treeview: Fix comparison to catch all cases

Otherwise, we could sometimes fail to update the cursor node when the
right row was deleted.

Also, I'd like to file a formal complaint that this node/tree
differentiation makes writing comparisons too complicated.

https://bugzilla.gnome.org/show_bug.cgi?id=668169
This commit is contained in:
Benjamin Otte 2012-01-24 15:44:03 +01:00
parent 080f8740f2
commit 2f3ffd5fde

View File

@ -9025,7 +9025,8 @@ gtk_tree_view_row_deleted (GtkTreeModel *model,
/* If the cursor row got deleted, move the cursor to the next row */
if (tree_view->priv->cursor_node &&
(tree_view->priv->cursor_node == node ||
(node->children && _gtk_rbtree_contains (node->children, tree_view->priv->cursor_tree))))
(node->children && (tree_view->priv->cursor_tree == node->children ||
_gtk_rbtree_contains (node->children, tree_view->priv->cursor_tree)))))
{
GtkTreePath *cursor_path;