treelistmodel: Improve naming a bit

The complexity with model items vs row items is really confusing. Add to
that treelistmodel position vs child model position vs parent position,
and you're so confused, even the best naming can't help.

And once you're there, consider passthrough vs non-passthrough...
This commit is contained in:
Benjamin Otte 2018-09-18 07:50:33 +02:00
parent 29c700d1c7
commit 2c84049769
4 changed files with 13 additions and 13 deletions

View File

@ -3383,7 +3383,7 @@ gtk_tree_list_model_get_model
gtk_tree_list_model_get_passthrough
gtk_tree_list_model_set_autoexpand
gtk_tree_list_model_get_autoexpand
gtk_tree_list_model_get_child
gtk_tree_list_model_get_child_row
gtk_tree_list_model_get_row
<SUBSECTION>
@ -3395,7 +3395,7 @@ gtk_tree_list_row_get_position
gtk_tree_list_row_get_depth
gtk_tree_list_row_get_children
gtk_tree_list_row_get_parent
gtk_tree_list_row_get_child
gtk_tree_list_row_get_child_row
<SUBSECTION Standard>
GTK_TREE_LIST_MODEL

View File

@ -881,7 +881,7 @@ gtk_tree_list_model_get_autoexpand (GtkTreeListModel *self)
* If @self is set to not be passthrough, this function is equivalent
* to calling g_list_model_get_item().
*
* Do not confuse this function with gtk_tree_list_model_get_child().
* Do not confuse this function with gtk_tree_list_model_get_child_row().
*
* Returns: (nullable) (transfer full): The row item
**/
@ -901,7 +901,7 @@ gtk_tree_list_model_get_row (GtkTreeListModel *self,
}
/**
* gtk_tree_list_model_get_child:
* gtk_tree_list_model_get_child_row:
* @self: a #GtkTreeListModel
* @position: position of the child to get
*
@ -916,8 +916,8 @@ gtk_tree_list_model_get_row (GtkTreeListModel *self,
* Returns: (nullable) (transfer full): the child in @position
**/
GtkTreeListRow *
gtk_tree_list_model_get_child (GtkTreeListModel *self,
guint position)
gtk_tree_list_model_get_child_row (GtkTreeListModel *self,
guint position)
{
TreeNode *child;
@ -1345,7 +1345,7 @@ gtk_tree_list_row_get_parent (GtkTreeListRow *self)
}
/**
* gtk_tree_list_row_get_child:
* gtk_tree_list_row_get_child_row:
* @self: a #GtkTreeListRow
* @position: position of the child to get
*
@ -1355,8 +1355,8 @@ gtk_tree_list_row_get_parent (GtkTreeListRow *self)
* Returns: (nullable) (transfer full): the child in @position
**/
GtkTreeListRow *
gtk_tree_list_row_get_child (GtkTreeListRow *self,
guint position)
gtk_tree_list_row_get_child_row (GtkTreeListRow *self,
guint position)
{
TreeNode *child;

View File

@ -76,7 +76,7 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_list_model_get_autoexpand (GtkTreeListModel *self);
GDK_AVAILABLE_IN_ALL
GtkTreeListRow * gtk_tree_list_model_get_child (GtkTreeListModel *self,
GtkTreeListRow * gtk_tree_list_model_get_child_row (GtkTreeListModel *self,
guint position);
GDK_AVAILABLE_IN_ALL
GtkTreeListRow * gtk_tree_list_model_get_row (GtkTreeListModel *self,
@ -100,7 +100,7 @@ GListModel * gtk_tree_list_row_get_children (GtkTreeListRow
GDK_AVAILABLE_IN_ALL
GtkTreeListRow * gtk_tree_list_row_get_parent (GtkTreeListRow *self);
GDK_AVAILABLE_IN_ALL
GtkTreeListRow * gtk_tree_list_row_get_child (GtkTreeListRow *self,
GtkTreeListRow * gtk_tree_list_row_get_child_row (GtkTreeListRow *self,
guint position);

View File

@ -1251,13 +1251,13 @@ find_and_expand_object (GtkTreeListModel *model,
gtk_tree_list_row_set_expanded (parent_row, TRUE);
pos = model_get_item_index (gtk_tree_list_row_get_children (parent_row), object);
result = gtk_tree_list_row_get_child (parent_row, pos);
result = gtk_tree_list_row_get_child_row (parent_row, pos);
g_object_unref (parent_row);
}
else
{
pos = model_get_item_index (gtk_tree_list_model_get_model (model), object);
result = gtk_tree_list_model_get_child (model, pos);
result = gtk_tree_list_model_get_child_row (model, pos);
}
return result;