gui/sidebar: Add a playlist update function that takes a playlist
Once we change the name of a playlist, we won't be able to find it in the sidebar model. So let's add a way to update an iterator by passing the playlist to use for updating. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
e773ae6f82
commit
2cfccb8177
|
@ -281,9 +281,9 @@ void gui_sidebar_iter_append_child(GtkTreeIter *iter, struct playlist *playlist,
|
||||||
__gui_sidebar_set_playlist(&new, playlist, image);
|
__gui_sidebar_set_playlist(&new, playlist, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gui_sidebar_iter_update(GtkTreeIter *iter)
|
void gui_sidebar_iter_update_playlist(GtkTreeIter *iter,
|
||||||
|
struct playlist *playlist)
|
||||||
{
|
{
|
||||||
struct playlist *playlist = gui_sidebar_iter_playlist(iter);
|
|
||||||
gchar *text;
|
gchar *text;
|
||||||
|
|
||||||
if (!playlist)
|
if (!playlist)
|
||||||
|
@ -294,6 +294,11 @@ void gui_sidebar_iter_update(GtkTreeIter *iter)
|
||||||
g_free(text);
|
g_free(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gui_sidebar_iter_update(GtkTreeIter *iter)
|
||||||
|
{
|
||||||
|
gui_sidebar_iter_update_playlist(iter, gui_sidebar_iter_playlist(iter));
|
||||||
|
}
|
||||||
|
|
||||||
void gui_sidebar_iter_select(GtkTreeIter *iter)
|
void gui_sidebar_iter_select(GtkTreeIter *iter)
|
||||||
{
|
{
|
||||||
GtkTreeSelection *selection;
|
GtkTreeSelection *selection;
|
||||||
|
|
|
@ -42,6 +42,7 @@ void gui_sidebar_iter_append_child(GtkTreeIter *, struct playlist *,
|
||||||
const gchar *);
|
const gchar *);
|
||||||
|
|
||||||
/* Called to update the playlist at the current iterator. */
|
/* Called to update the playlist at the current iterator. */
|
||||||
|
void gui_sidebar_iter_update_playlist(GtkTreeIter *, struct playlist *);
|
||||||
void gui_sidebar_iter_update(GtkTreeIter *);
|
void gui_sidebar_iter_update(GtkTreeIter *);
|
||||||
|
|
||||||
/* Called to select the row at the current iterator. */
|
/* Called to select the row at the current iterator. */
|
||||||
|
|
Loading…
Reference in New Issue