diff --git a/gui/collection_tab.cpp b/gui/collection_tab.cpp index 0575d95f..f295da36 100644 --- a/gui/collection_tab.cpp +++ b/gui/collection_tab.cpp @@ -5,6 +5,7 @@ extern "C" { #include #include #include +#include } #include #include @@ -55,11 +56,7 @@ static CollectionTab *collection_tab; static void *collection_init(struct queue *queue) { - return collection_tab; -} - -static void collection_deinit(struct queue *queue) -{ + return gui_queue_alloc(queue, "Collection"); } static void collection_added(struct queue *queue, unsigned int pos) @@ -88,7 +85,7 @@ static void collection_updated(struct queue *queue, unsigned int pos) struct queue_ops collection_ops = { collection_init, - collection_deinit, + gui_queue_free, collection_added, collection_removed, collection_cleared, diff --git a/gui/history.cpp b/gui/history.cpp index d4deadee..652a26bb 100644 --- a/gui/history.cpp +++ b/gui/history.cpp @@ -4,6 +4,7 @@ extern "C" { #include #include +#include } #include #include @@ -40,11 +41,7 @@ static HistoryTab *history_tab; static void *history_init(struct queue *queue) { - return history_tab; -} - -static void history_deinit(struct queue *queue) -{ + return gui_queue_alloc(queue, "History"); } static void history_added(struct queue *queue, unsigned int pos) @@ -70,7 +67,7 @@ static void history_updated(struct queue *queue, unsigned int pos) struct queue_ops history_ops = { history_init, - history_deinit, + gui_queue_free, history_added, history_removed, history_cleared, diff --git a/gui/playlist_tab.cpp b/gui/playlist_tab.cpp index 5de7146b..4909e38d 100644 --- a/gui/playlist_tab.cpp +++ b/gui/playlist_tab.cpp @@ -7,6 +7,7 @@ extern "C" { #include #include #include +#include } #include #include @@ -86,11 +87,7 @@ static void on_favorite() static void *playlist_init(struct queue *queue) { - return p_tab; -} - -static void playlist_deinit(struct queue *queue) -{ + return gui_queue_alloc(queue, "Playlist"); } static void playlist_added(struct queue *queue, unsigned int pos) @@ -116,7 +113,7 @@ static void playlist_updated(struct queue *queue, unsigned int pos) struct queue_ops playlist_ops = { playlist_init, - playlist_deinit, + gui_queue_free, playlist_added, playlist_removed, playlist_cleared, diff --git a/gui/tabs.cpp b/gui/tabs.cpp index 16848efe..7dd957a1 100644 --- a/gui/tabs.cpp +++ b/gui/tabs.cpp @@ -7,6 +7,7 @@ extern "C" { #include #include #include +#include #include } #include @@ -25,12 +26,7 @@ static compare_t sort_fields[] = { static void *tempq_init(struct queue *queue) { - return NULL; -} - -static void tempq_deinit(struct queue *queue) -{ - + return gui_queue_alloc(queue, "Queued Tracks"); } static void tempq_added(struct queue *queue, unsigned int pos) @@ -60,7 +56,7 @@ static void tempq_updated(struct queue *queue, unsigned int pos) struct queue_ops tempq_ops = { tempq_init, - tempq_deinit, + gui_queue_free, tempq_added, tempq_removed, tempq_cleared, diff --git a/include/gui/queue.h b/include/gui/queue.h index a720a52d..a8206664 100644 --- a/include/gui/queue.h +++ b/include/gui/queue.h @@ -21,7 +21,7 @@ void gui_queue_free(struct queue *); /* Called to access a the struct gui_queue attached to a queue. */ static inline struct gui_queue *gui_queue(struct queue *queue) { - return queue->q_private; + return (struct gui_queue *)queue->q_private; } #endif /* OCARINA_GUI_QUEUE_H */