check the return value of _gtk_tree_view_find_node and return if it's

Mon Apr  8 20:28:54 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreeselection.c (gtk_tree_selection_select_path),
        (gtk_tree_selection_unselect_path),
        (gtk_tree_selection_path_is_selected): check the return value of
        _gtk_tree_view_find_node and return if it's TRUE. This makes those
        functions work somewhat saner on non-expanded trees.
This commit is contained in:
Kristian Rietveld 2002-04-08 17:42:45 +00:00 committed by Kristian Rietveld
parent 673e14fe8d
commit 18dfabc12e
7 changed files with 69 additions and 15 deletions

View File

@ -1,3 +1,11 @@
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free

View File

@ -1,3 +1,11 @@
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free

View File

@ -1,3 +1,11 @@
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free

View File

@ -1,3 +1,11 @@
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free

View File

@ -1,3 +1,11 @@
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free

View File

@ -1,3 +1,11 @@
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free

View File

@ -527,17 +527,19 @@ gtk_tree_selection_select_path (GtkTreeSelection *selection,
GtkRBNode *node;
GtkRBTree *tree;
GdkModifierType state = 0;
gboolean ret;
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
g_return_if_fail (selection->tree_view != NULL);
g_return_if_fail (path != NULL);
_gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
ret = _gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
if (node == NULL || GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
if (node == NULL || GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) ||
ret == TRUE)
return;
if (selection->type == GTK_SELECTION_MULTIPLE)
@ -563,17 +565,19 @@ gtk_tree_selection_unselect_path (GtkTreeSelection *selection,
{
GtkRBNode *node;
GtkRBTree *tree;
gboolean ret;
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
g_return_if_fail (selection->tree_view != NULL);
g_return_if_fail (path != NULL);
_gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
ret = _gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
if (node == NULL || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
if (node == NULL || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) ||
ret == TRUE)
return;
_gtk_tree_selection_internal_select_node (selection,
@ -656,18 +660,20 @@ gtk_tree_selection_path_is_selected (GtkTreeSelection *selection,
{
GtkRBNode *node;
GtkRBTree *tree;
gboolean ret;
g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), FALSE);
g_return_val_if_fail (path != NULL, FALSE);
g_return_val_if_fail (selection->tree_view != NULL, FALSE);
g_return_val_if_fail (selection->tree_view->priv->model != NULL, FALSE);
_gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
ret = _gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
if ((node == NULL) || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
if ((node == NULL) || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) ||
ret == TRUE)
return FALSE;
return TRUE;