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 <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
ae916eaf40
commit
9a216fee1e
|
@ -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));
|
||||
|
|
|
@ -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 *);
|
||||
|
||||
|
|
|
@ -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)));
|
||||
|
|
Loading…
Reference in New Issue