From 0f05628cb3e0ec3e4b5811267afae94b50d5eb6b Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Wed, 10 Oct 2001 19:21:41 +0000 Subject: [PATCH] cvs got a broken pipe signal, missed these two. ChangeLog is already there. --- gtk/gtktreemodel.c | 33 +++++++++++++++++++++++++++++++++ gtk/gtktreemodel.h | 3 +++ 2 files changed, 36 insertions(+) diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index daba5bf7d0..f4a08ba693 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -651,6 +651,39 @@ gtk_tree_model_get_iter (GtkTreeModel *tree_model, return (* GTK_TREE_MODEL_GET_IFACE (tree_model)->get_iter) (tree_model, iter, path); } +/** + * gtk_tree_model_get_iter_from_string: + * @tree_model: A #GtkTreeModel. + * @iter: An uninitialized #GtkTreeIter. + * @path_string: A string representation of a #GtkTreePath. + * + * Sets @iter to a valid iterator pointing to @path_string, if it + * exists. Otherwise, @iter is left invalid and %FALSE is returned. + * + * Return value: TRUE, if @iter was set. + **/ +gboolean +gtk_tree_model_get_iter_from_string (GtkTreeModel *tree_model, + GtkTreeIter *iter, + const gchar *path_string) +{ + gboolean retval; + GtkTreePath *path; + + g_return_val_if_fail (GTK_IS_TREE_MODEL (tree_model), FALSE); + g_return_val_if_fail (iter != NULL, FALSE); + g_return_val_if_fail (path_string != NULL, FALSE); + + path = gtk_tree_path_new_from_string (path_string); + + g_return_val_if_fail (path != NULL, FALSE); + + retval = gtk_tree_model_get_iter (tree_model, iter, path); + gtk_tree_path_free (path); + + return retval; +} + /** * gtk_tree_model_get_iter_root: diff --git a/gtk/gtktreemodel.h b/gtk/gtktreemodel.h index 8caf190b6b..64e7edd6d1 100644 --- a/gtk/gtktreemodel.h +++ b/gtk/gtktreemodel.h @@ -176,6 +176,9 @@ GType gtk_tree_model_get_column_type (GtkTreeModel *tree_model, gboolean gtk_tree_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path); +gboolean gtk_tree_model_get_iter_from_string (GtkTreeModel *tree_model, + GtkTreeIter *iter, + const gchar *path_string); gboolean gtk_tree_model_get_iter_root (GtkTreeModel *tree_model, GtkTreeIter *iter); GtkTreePath * gtk_tree_model_get_path (GtkTreeModel *tree_model,