db/update/Service: use DatabaseListener instead of Instance

Don't use the global variable "instance".
This commit is contained in:
Max Kellermann
2014-02-04 18:51:01 +01:00
parent c5fa8ed321
commit eec6d09959
3 changed files with 12 additions and 6 deletions

View File

@@ -27,6 +27,7 @@
#include "thread/Thread.hxx"
class SimpleDatabase;
class DatabaseListener;
/**
* This class manages the update queue and runs the update thread.
@@ -40,6 +41,8 @@ class UpdateService final : DeferredMonitor {
SimpleDatabase &db;
DatabaseListener &listener;
Progress progress;
bool modified;
@@ -57,7 +60,8 @@ class UpdateService final : DeferredMonitor {
UpdateWalk walk;
public:
UpdateService(EventLoop &_loop, SimpleDatabase &_db);
UpdateService(EventLoop &_loop, SimpleDatabase &_db,
DatabaseListener &_listener);
/**
* Returns a non-zero job id when we are currently updating