From d6ae61d915945f7d72daf942ae2744f3a96c73fa Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Fri, 20 Nov 2015 10:19:14 -0500 Subject: [PATCH] core/queue: Remove queue :: set_notifier() Let's just set the q_notify variable directly, rather than going through a function. Signed-off-by: Anna Schumaker --- core/queue.cpp | 5 ----- gui/tabs.cpp | 2 +- include/core/queue.h | 8 -------- tests/core/deck.cpp | 4 ++-- tests/core/queue.cpp | 4 ++-- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/core/queue.cpp b/core/queue.cpp index b9ddda22..60161432 100644 --- a/core/queue.cpp +++ b/core/queue.cpp @@ -65,11 +65,6 @@ bool queue :: has_flag(queue_flags flag) return (q_flags & flag) == (unsigned int)flag; } -void queue :: set_notifier(QNotifier *notify) -{ - q_notify = notify; -} - static bool track_less_than(struct track *lhs, struct track *rhs, std::vector &order) { diff --git a/gui/tabs.cpp b/gui/tabs.cpp index b0e13c06..e393d1ed 100644 --- a/gui/tabs.cpp +++ b/gui/tabs.cpp @@ -31,7 +31,7 @@ static compare_t sort_fields[] = { Tab :: Tab(queue *pq) : tab_sorting_count(0), tab_pq(pq), tab_label(NULL) { - pq->set_notifier(this); + pq->q_notify = this; queue_mapping[tab_pq] = this; tab_builder = Gtk::Builder::create(); diff --git a/include/core/queue.h b/include/core/queue.h index b62df1bb..98f39ae9 100644 --- a/include/core/queue.h +++ b/include/core/queue.h @@ -133,14 +133,6 @@ struct queue { bool has_flag(queue_flags); - /** - * Set a notifier for this queue. - * - * @param notify notifier instance to associate with this queue. - */ - void set_notifier(QNotifier *); - - /** * Add a track to the queue, possibly matching the * current sort order. diff --git a/tests/core/deck.cpp b/tests/core/deck.cpp index 77f0f7d6..3d38ca91 100644 --- a/tests/core/deck.cpp +++ b/tests/core/deck.cpp @@ -77,7 +77,7 @@ static void test_create_mv_destroy() queue *q1, *q2; q1 = deck :: create(true); - q1->set_notifier(&test_notifier); + q1->q_notify = &test_notifier; test_not_equal(q1, Q_NULL); test_equal(q1->has_flag(Q_ENABLED), true); test_equal(q1->has_flag(Q_RANDOM), true); @@ -85,7 +85,7 @@ static void test_create_mv_destroy() test_equal(deck :: get(2), q1); q2 = deck :: create(false); - q2->set_notifier(&test_notifier); + q2->q_notify = &test_notifier; test_not_equal(q2, Q_NULL); test_equal(q2->has_flag(Q_ENABLED), true); test_equal(q2->has_flag(Q_RANDOM), false); diff --git a/tests/core/queue.cpp b/tests/core/queue.cpp index a6bda64e..6b1c8cf2 100644 --- a/tests/core/queue.cpp +++ b/tests/core/queue.cpp @@ -68,7 +68,7 @@ static void test_init() test_not_equal(q.q_notify, NULL); q = queue(Q_ENABLED | Q_RANDOM); - q.set_notifier(&test_notifier); + q.q_notify = &test_notifier; test_equal(q.q_cur, (unsigned int )-1); test_equal(q.q_flags, Q_ENABLED | Q_RANDOM); @@ -115,7 +115,7 @@ static void test_stress(unsigned int N) count_added = 0; count_deleted = 0; count_updated = 0; - q.set_notifier(&test_notifier); + q.q_notify = &test_notifier; /* Queue :: add() */ for (i = 0; i < N; i++) {