aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/update/UpdateGlue.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-04 18:51:01 +0100
committerMax Kellermann <max@duempel.org>2014-02-04 18:54:54 +0100
commiteec6d0995982a59960dfb38cddad8bf4567e6b3c (patch)
tree7a0901cc355792948d52b9626512fe4463500546 /src/db/update/UpdateGlue.cxx
parentc5fa8ed3217a9223f5e36fdda23021a47e0f81ac (diff)
downloadmpd-eec6d0995982a59960dfb38cddad8bf4567e6b3c.tar.gz
mpd-eec6d0995982a59960dfb38cddad8bf4567e6b3c.tar.xz
mpd-eec6d0995982a59960dfb38cddad8bf4567e6b3c.zip
db/update/Service: use DatabaseListener instead of Instance
Don't use the global variable "instance".
Diffstat (limited to '')
-rw-r--r--src/db/update/UpdateGlue.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/db/update/UpdateGlue.cxx b/src/db/update/UpdateGlue.cxx
index 40fe68afc..ea1bf6f09 100644
--- a/src/db/update/UpdateGlue.cxx
+++ b/src/db/update/UpdateGlue.cxx
@@ -20,11 +20,11 @@
#include "config.h"
#include "Service.hxx"
#include "UpdateDomain.hxx"
+#include "db/DatabaseListener.hxx"
#include "db/plugins/SimpleDatabasePlugin.hxx"
#include "Idle.hxx"
#include "util/Error.hxx"
#include "Log.hxx"
-#include "Main.hxx"
#include "Instance.hxx"
#include "system/FatalError.hxx"
#include "thread/Id.hxx"
@@ -139,7 +139,7 @@ UpdateService::RunDeferred()
if (modified)
/* send "idle" events */
- instance->DatabaseModified();
+ listener.OnDatabaseModified();
auto i = queue.Pop();
if (i.IsDefined()) {
@@ -150,8 +150,10 @@ UpdateService::RunDeferred()
}
}
-UpdateService::UpdateService(EventLoop &_loop, SimpleDatabase &_db)
- :DeferredMonitor(_loop), db(_db), progress(UPDATE_PROGRESS_IDLE),
+UpdateService::UpdateService(EventLoop &_loop, SimpleDatabase &_db,
+ DatabaseListener &_listener)
+ :DeferredMonitor(_loop), db(_db), listener(_listener),
+ progress(UPDATE_PROGRESS_IDLE),
update_task_id(0),
walk(_loop)
{