diff options
author | Jorn Baayen <jbaayen@src.gnome.org> | 2003-04-19 23:08:17 +0800 |
---|---|---|
committer | Jorn Baayen <jbaayen@src.gnome.org> | 2003-04-19 23:08:17 +0800 |
commit | e67869280305fba213814f2cefa8c8d0aa0f36c7 (patch) | |
tree | 42548753354cea94f75a978232ed428129e9b9c8 | |
parent | 223c64a4749f008236d5523bb7a6bfd696ff0ffe (diff) | |
download | gsoc2013-epiphany-e67869280305fba213814f2cefa8c8d0aa0f36c7.tar gsoc2013-epiphany-e67869280305fba213814f2cefa8c8d0aa0f36c7.tar.gz gsoc2013-epiphany-e67869280305fba213814f2cefa8c8d0aa0f36c7.tar.bz2 gsoc2013-epiphany-e67869280305fba213814f2cefa8c8d0aa0f36c7.tar.lz gsoc2013-epiphany-e67869280305fba213814f2cefa8c8d0aa0f36c7.tar.xz gsoc2013-epiphany-e67869280305fba213814f2cefa8c8d0aa0f36c7.tar.zst gsoc2013-epiphany-e67869280305fba213814f2cefa8c8d0aa0f36c7.zip |
slight treemodel cleanup
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | lib/widgets/ephy-tree-model-node.c | 15 |
2 files changed, 18 insertions, 8 deletions
@@ -1,3 +1,14 @@ +2003-04-19 Jorn Baayen <jorn@nl.linux.org> + + * lib/widgets/ephy-tree-model-node.c: (ephy_tree_model_node_init), + (ephy_tree_model_node_finalize), + (ephy_tree_model_node_add_prop_column), + (ephy_tree_model_node_add_func_column), + (ephy_tree_model_node_get_column_type), + (ephy_tree_model_node_get_value): + + Use a GPtrArray rather than a GList for columns. + 2003-04-19 Xan Lopez <xan@masilla.org> * src/ephy-shell.c: (ephy_shell_new_tab): diff --git a/lib/widgets/ephy-tree-model-node.c b/lib/widgets/ephy-tree-model-node.c index 58b0f0baf..180e24879 100644 --- a/lib/widgets/ephy-tree-model-node.c +++ b/lib/widgets/ephy-tree-model-node.c @@ -88,7 +88,7 @@ struct EphyTreeModelNodePrivate EphyNodeFilter *filter; - GList *columns; + GPtrArray *columns; int columns_num; }; @@ -193,7 +193,7 @@ ephy_tree_model_node_init (EphyTreeModelNode *model) gtk_widget_destroy (dummy); - model->priv->columns = NULL; + model->priv->columns = g_ptr_array_new (); model->priv->columns_num = EPHY_TREE_MODEL_NODE_BUILTIN_COLUMNS; } @@ -209,8 +209,7 @@ ephy_tree_model_node_finalize (GObject *object) g_return_if_fail (model->priv != NULL); - g_list_foreach (model->priv->columns, (GFunc) g_free, NULL); - g_list_free (model->priv->columns); + g_ptr_array_free (model->priv->columns, TRUE); g_free (model->priv); @@ -340,7 +339,7 @@ ephy_tree_model_node_add_prop_column (EphyTreeModelNode *model, col->func = NULL; col->user_data = NULL; - model->priv->columns = g_list_append (model->priv->columns, col); + g_ptr_array_add (model->priv->columns, col); model->priv->columns_num++; return model->priv->columns_num; @@ -360,7 +359,7 @@ ephy_tree_model_node_add_func_column (EphyTreeModelNode *model, col->func = func; col->user_data = user_data; - model->priv->columns = g_list_append (model->priv->columns, col); + g_ptr_array_add (model->priv->columns, col); model->priv->columns_num++; return model->priv->columns_num; @@ -386,7 +385,7 @@ ephy_tree_model_node_get_column_type (GtkTreeModel *tree_model, return G_TYPE_BOOLEAN; list_index = index - EPHY_TREE_MODEL_NODE_BUILTIN_COLUMNS - 1; - col = g_list_nth_data (model->priv->columns, list_index); + col = g_ptr_array_index (model->priv->columns, list_index); return col->type; } @@ -429,7 +428,7 @@ ephy_tree_model_node_get_value (GtkTreeModel *tree_model, else { list_index = column - EPHY_TREE_MODEL_NODE_BUILTIN_COLUMNS - 1; - col = g_list_nth_data (model->priv->columns, list_index); + col = g_ptr_array_index (model->priv->columns, list_index); g_return_if_fail (col != NULL); |