aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/update/Service.hxx6
-rw-r--r--src/db/update/UpdateGlue.cxx10
2 files changed, 11 insertions, 5 deletions
diff --git a/src/db/update/Service.hxx b/src/db/update/Service.hxx
index 815be6dbc..a41c311b6 100644
--- a/src/db/update/Service.hxx
+++ b/src/db/update/Service.hxx
@@ -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
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)
{