[gtk] treelistmodel: Improve naming a bit
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] treelistmodel: Improve naming a bit
- Date: Tue, 18 Sep 2018 06:05:39 +0000 (UTC)
commit 2c84049769470d1bf8895d59c0fd5c8d53373985
Author: Benjamin Otte <otte redhat com>
Date: Tue Sep 18 07:50:33 2018 +0200
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...
docs/reference/gtk/gtk4-sections.txt | 4 ++--
gtk/gtktreelistmodel.c | 14 +++++++-------
gtk/gtktreelistmodel.h | 4 ++--
gtk/inspector/object-tree.c | 4 ++--
4 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index ea0709487e..dd88c0206f 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -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
diff --git a/gtk/gtktreelistmodel.c b/gtk/gtktreelistmodel.c
index c619347e54..3848e12e93 100644
--- a/gtk/gtktreelistmodel.c
+++ b/gtk/gtktreelistmodel.c
@@ -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;
diff --git a/gtk/gtktreelistmodel.h b/gtk/gtktreelistmodel.h
index 40c4d57262..df41500ecc 100644
--- a/gtk/gtktreelistmodel.h
+++ b/gtk/gtktreelistmodel.h
@@ -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);
diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c
index adf50f1347..ff2d0d060e 100644
--- a/gtk/inspector/object-tree.c
+++ b/gtk/inspector/object-tree.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]