queue: Remove on_remove() notification
I no longer need it to pass queue-removed messages to the gui. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
f15ed8635a
commit
9180545bc2
|
@ -13,7 +13,6 @@
|
|||
static class DefaultNotifier : public QNotifier {
|
||||
public:
|
||||
DefaultNotifier() {};
|
||||
void on_remove() {};
|
||||
void on_track_added(unsigned int pos) {};
|
||||
void on_track_removed(unsigned int pos) {};
|
||||
void on_track_updated(unsigned int pos) {};
|
||||
|
@ -29,10 +28,7 @@ Queue :: Queue()
|
|||
{}
|
||||
|
||||
Queue :: ~Queue()
|
||||
{
|
||||
if (has_flag(Q_NOTIFY_REMOVE))
|
||||
_notify->on_remove();
|
||||
}
|
||||
{}
|
||||
|
||||
void Queue :: write(File &file)
|
||||
{
|
||||
|
|
|
@ -48,11 +48,6 @@ class QNotifier {
|
|||
public:
|
||||
QNotifier() {}; /**< Notifier constructor. */
|
||||
|
||||
/**
|
||||
* Called when a queue is removed and destroyed.
|
||||
*/
|
||||
virtual void on_remove() = 0;
|
||||
|
||||
/**
|
||||
* Called when a track is added to a queue.
|
||||
*
|
||||
|
|
|
@ -59,11 +59,9 @@ static void test_init()
|
|||
f.close();
|
||||
}
|
||||
|
||||
static unsigned int n = 0;
|
||||
static class TestNotifier : public QNotifier {
|
||||
public:
|
||||
TestNotifier() : QNotifier() {}
|
||||
void on_remove() { n++; }
|
||||
void on_track_added(unsigned int i) {}
|
||||
void on_track_removed(unsigned int i) {}
|
||||
void on_track_updated(unsigned int i) {}
|
||||
|
@ -97,12 +95,10 @@ static void test_create_mv_destroy()
|
|||
test_equal(deck :: index(q1), (unsigned)2);
|
||||
|
||||
deck :: destroy(q1);
|
||||
test_equal(n, (unsigned)1);
|
||||
test_equal(deck :: index(q1), (unsigned)3);
|
||||
test_equal(deck :: index(q2), (unsigned)2);
|
||||
|
||||
deck :: destroy(q2);
|
||||
test_equal(n, (unsigned)2);
|
||||
test_equal(deck :: index(q2), (unsigned)2);
|
||||
|
||||
test_equal(deck :: get(3), Q_NULL);
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <tests/test.h>
|
||||
|
||||
|
||||
unsigned int count_destroyed = 0;
|
||||
unsigned int count_add = 0;
|
||||
unsigned int count_del = 0;
|
||||
unsigned int count_updated = 0;
|
||||
|
@ -19,7 +18,6 @@ Track *TRACK_NULL = NULL;
|
|||
static class TestNotifier : public QNotifier {
|
||||
public:
|
||||
TestNotifier() : QNotifier() {}
|
||||
void on_remove() { count_destroyed++; }
|
||||
void on_track_added(unsigned int i) { count_add++; }
|
||||
void on_track_removed(unsigned int i) { count_del++; }
|
||||
void on_track_updated(unsigned int i) { count_updated++; last_update = i; }
|
||||
|
@ -87,27 +85,6 @@ void test_flags()
|
|||
}
|
||||
|
||||
|
||||
unsigned int _test_destructor_null(unsigned int i)
|
||||
{
|
||||
TestQueue *q = new TestQueue(0);
|
||||
delete q;
|
||||
return (count_destroyed == 0) ? LOOP_PASSED : LOOP_FAILED;
|
||||
}
|
||||
|
||||
unsigned int _test_destructor_flag(unsigned int i)
|
||||
{
|
||||
TestQueue *q = new TestQueue(Q_NOTIFY_REMOVE);
|
||||
delete q;
|
||||
return (count_destroyed == (i + 1)) ? LOOP_PASSED : LOOP_FAILED;
|
||||
}
|
||||
|
||||
void test_destructor()
|
||||
{
|
||||
test_for_each(0, 10, 1, _test_destructor_null);
|
||||
test_for_each(0, 10, 1, _test_destructor_flag);
|
||||
}
|
||||
|
||||
|
||||
unsigned int _test_add_loop(unsigned int i)
|
||||
{
|
||||
Track *track = tags :: get_track(i % 24);
|
||||
|
@ -386,7 +363,6 @@ int main(int argc, char **argv)
|
|||
test :: run("Queue Default Constructor Test", test_default);
|
||||
test :: run("Queue Constructor Test", test_constructor);
|
||||
test :: run("Queue Flag Test", test_flags);
|
||||
test :: run("Queue Destructor Test", test_destructor);
|
||||
test :: run("Queue Add and Remove Test", test_add_remove);
|
||||
test :: run("Queue Track Updated Test", test_updated);
|
||||
test :: run("Queue Pick Next Test", test_next);
|
||||
|
|
Loading…
Reference in New Issue