From 9a216fee1eccc259f35e4a4d2932aa07646aea68 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Wed, 28 Sep 2016 10:04:28 -0400 Subject: [PATCH] gui/queue: Remove unused GQ_CAN_REPEAT and GQ_CAN_DISABLE flags These go unused as a result of our recent playlist changes, so we can remove them now. Signed-off-by: Anna Schumaker --- gui/playlist.c | 2 -- include/gui/queue.h | 18 ------------------ tests/gui/queue.c | 10 ++-------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/gui/playlist.c b/gui/playlist.c index 9af829ba..b8bd0c22 100644 --- a/gui/playlist.c +++ b/gui/playlist.c @@ -247,8 +247,6 @@ static void *__playlist_init(struct queue *queue, void *data) if (!string_match(playlist->pl_name, "History")) flags = GQ_CAN_RANDOM; - if (string_match(playlist->pl_name, "Queued Tracks")) - flags = GQ_CAN_REPEAT; if (p_init_done && playlist->pl_type == PL_ARTIST) { p_filter_enable = false; gui_playlist_add_artist(artist_find(playlist->pl_name)); diff --git a/include/gui/queue.h b/include/gui/queue.h index cddce8d7..c9f2ef62 100644 --- a/include/gui/queue.h +++ b/include/gui/queue.h @@ -9,8 +9,6 @@ enum gui_queue_flags { GQ_CAN_RANDOM = (1 << 0), /* Random button can be clicked. */ - GQ_CAN_REPEAT = (1 << 1), /* Repeat button can be clicked. */ - GQ_CAN_DISABLE = (1 << 2), /* Disable switch can be clicked. */ }; struct gui_queue { @@ -48,22 +46,6 @@ static inline bool gui_queue_can_random(struct gui_queue *gq) return false; } -/* Called to ask the struct gui_queue if it can change repeat flag. */ -static inline bool gui_queue_can_repeat(struct gui_queue *gq) -{ - if (gq) - return (gq->gq_flags & GQ_CAN_REPEAT) == GQ_CAN_REPEAT; - return false; -} - -/* Called to ask the struct gui_queue if it can change enabled flag. */ -static inline bool gui_queue_can_disable(struct gui_queue *gq) -{ - if (gq) - return (gq->gq_flags & GQ_CAN_DISABLE) == GQ_CAN_DISABLE; - return false; -} - /* Called to set the correct state of the random and repeat buttons. */ void gui_queue_show(struct gui_queue *); diff --git a/tests/gui/queue.c b/tests/gui/queue.c index f08d5bee..bfb5292d 100644 --- a/tests/gui/queue.c +++ b/tests/gui/queue.c @@ -11,8 +11,7 @@ static void *test_queue_init(struct queue *queue, void *data) { - return gui_queue_alloc(NULL, queue, "Test Queue", - GQ_CAN_RANDOM | GQ_CAN_REPEAT | GQ_CAN_DISABLE); + return gui_queue_alloc(NULL, queue, "Test Queue", GQ_CAN_RANDOM); } static void test_queue_save(struct queue *queue, unsigned int row) {} @@ -46,13 +45,8 @@ static void test_queue() gq = gui_queue(&q); g_assert_true(gui_queue_can_random(gq)); - g_assert_true(gui_queue_can_repeat(gq)); - g_assert_true(gui_queue_can_disable(gq)); - gq->gq_flags = 0; g_assert_false(gui_queue_can_random(gq)); - g_assert_false(gui_queue_can_repeat(gq)); - g_assert_false(gui_queue_can_disable(gq)); gtk_entry_set_text(search, "Test text"); @@ -70,7 +64,7 @@ static void test_queue() g_assert_false(queue_has_flag(&q, Q_RANDOM)); /* Show a queue where random and repeat are enabled */ - gq->gq_flags = GQ_CAN_RANDOM | GQ_CAN_REPEAT | GQ_CAN_DISABLE; + gq->gq_flags = GQ_CAN_RANDOM; q.q_flags = Q_RANDOM | Q_REPEAT | Q_ENABLED; gui_queue_show(gq); g_assert_true(gtk_widget_get_sensitive(GTK_WIDGET(random)));