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 <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-11-20 10:19:14 -05:00
parent a721a95604
commit d6ae61d915
5 changed files with 5 additions and 18 deletions

View File

@ -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<struct sort_info> &order)
{

View File

@ -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();

View File

@ -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.

View File

@ -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);

View File

@ -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++) {