diff --git a/gui/playlist.c b/gui/playlist.c index 42cb29a1..ce165e2f 100644 --- a/gui/playlist.c +++ b/gui/playlist.c @@ -138,7 +138,7 @@ static void *__playlist_init(struct queue *queue, void *data) if (string_match(playlist->pl_name, "Collection")) flags = GQ_CAN_RANDOM; - return gui_queue_alloc(queue, playlist->pl_name, flags); + return gui_queue_alloc(playlist, queue, playlist->pl_name, flags); } static void __playlist_added(struct queue *queue, unsigned int row) diff --git a/gui/queue.c b/gui/queue.c index ebaec87c..57f144d1 100644 --- a/gui/queue.c +++ b/gui/queue.c @@ -99,8 +99,8 @@ void __queue_filter(GtkSearchEntry *entry, gpointer data) } } -struct gui_queue *gui_queue_alloc(struct queue *queue, const gchar *text, - unsigned int flags) +struct gui_queue *gui_queue_alloc(struct playlist *playlist, struct queue *queue, + const gchar *text, unsigned int flags) { struct gui_queue *gq = g_malloc(sizeof(struct gui_queue)); @@ -110,7 +110,8 @@ struct gui_queue *gui_queue_alloc(struct queue *queue, const gchar *text, gq->gq_model = gui_queue_model_new(queue); gq->gq_filter = gtk_tree_model_filter_new( GTK_TREE_MODEL(gq->gq_model), NULL); - gq->gq_queue = queue; + gq->gq_playlist = playlist; + gq->gq_queue = queue; gq->gq_visible = NULL; gtk_tree_model_filter_set_visible_func( diff --git a/gui/tempq.c b/gui/tempq.c index 928cc472..24a6e865 100644 --- a/gui/tempq.c +++ b/gui/tempq.c @@ -11,7 +11,7 @@ static void *__tempq_init(struct queue *queue, void *data) { struct gui_queue *gq; - gq = gui_queue_alloc(queue, "Queued Tracks", TEMPQ_FLAGS); + gq = gui_queue_alloc(NULL, queue, "Queued Tracks", TEMPQ_FLAGS); gui_sidebar_add(gq); return gq; } diff --git a/include/gui/queue.h b/include/gui/queue.h index e57110e0..9b072e83 100644 --- a/include/gui/queue.h +++ b/include/gui/queue.h @@ -18,15 +18,17 @@ struct gui_queue { gchar *gq_text; gchar *gq_search; - GuiQueueModel *gq_model; - GtkTreeModel *gq_filter; - struct queue *gq_queue; - GHashTable *gq_visible; + GuiQueueModel *gq_model; + GtkTreeModel *gq_filter; + struct playlist *gq_playlist; + struct queue *gq_queue; + GHashTable *gq_visible; }; /* Called to allocate a new struct gui_queue. */ -struct gui_queue *gui_queue_alloc(struct queue *, const gchar *, unsigned int); +struct gui_queue *gui_queue_alloc(struct playlist *, struct queue *, + const gchar *, unsigned int); /* Called to free a struct gui_queue. */ void gui_queue_free(struct queue *); diff --git a/tests/gui/queue.c b/tests/gui/queue.c index a31ee045..8620379d 100644 --- a/tests/gui/queue.c +++ b/tests/gui/queue.c @@ -18,7 +18,7 @@ static void *test_queue_init(struct queue *queue, void *data) { - return gui_queue_alloc(queue, "Test Queue", + return gui_queue_alloc(NULL, queue, "Test Queue", GQ_CAN_RANDOM | GQ_CAN_REPEAT | GQ_CAN_DISABLE); }