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:
parent
2cfccb8177
commit
3f9372051f
|
@ -362,3 +362,14 @@ gboolean gui_sidebar_iter_find(GtkTreeIter *iter, const gchar *name,
|
||||||
|
|
||||||
return FALSE;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -64,6 +64,9 @@ void gui_sidebar_filter_row_expanded(GtkTreeIter *, bool);
|
||||||
gboolean gui_sidebar_iter_find(GtkTreeIter *, const gchar *,
|
gboolean gui_sidebar_iter_find(GtkTreeIter *, const gchar *,
|
||||||
enum playlist_type_t);
|
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. */
|
/* Called to get the sidebar widget. */
|
||||||
static inline GtkPaned *gui_sidebar()
|
static inline GtkPaned *gui_sidebar()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue