gui/sidebar: Add a function for setting an iterator from string

The GtkTreeView editing callbacks give me a path string that I'll need
to convert into an iterator to find the edited playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-10-01 11:32:31 -04:00
parent 2cfccb8177
commit 3f9372051f
2 changed files with 14 additions and 0 deletions

View File

@ -362,3 +362,14 @@ gboolean gui_sidebar_iter_find(GtkTreeIter *iter, const gchar *name,
return FALSE;
}
gboolean gui_sidebar_iter_from_string(const gchar *path, GtkTreeIter *child)
{
GtkTreeModel *model = GTK_TREE_MODEL(gui_sidebar_filter());
GtkTreeIter iter;
if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
return FALSE;
__gui_sidebar_filter_iter_convert(&iter, child);
return TRUE;
}

View File

@ -64,6 +64,9 @@ void gui_sidebar_filter_row_expanded(GtkTreeIter *, bool);
gboolean gui_sidebar_iter_find(GtkTreeIter *, const gchar *,
enum playlist_type_t);
/* Called to set the a GtkTreeIter to the row at path string */
gboolean gui_sidebar_iter_from_string(const gchar *, GtkTreeIter *);
/* Called to get the sidebar widget. */
static inline GtkPaned *gui_sidebar()
{