diff options
author | Max Kellermann <max@musicpd.org> | 2018-07-17 22:39:52 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-07-17 22:39:52 +0200 |
commit | 338a6f2a96e269b34297e26545f9e0243949867b (patch) | |
tree | cbadfb851e31a78ebc260d0874d23e0622feb8a3 | |
parent | c3aa53cc97c3119eba0fd26203d63cc1bf60c70e (diff) |
db/update/Walk: move UpdateConfig initialization to class UpdateService
-rw-r--r-- | src/db/update/Service.cxx | 2 | ||||
-rw-r--r-- | src/db/update/Service.hxx | 3 | ||||
-rw-r--r-- | src/db/update/Walk.cxx | 5 | ||||
-rw-r--r-- | src/db/update/Walk.hxx | 3 |
4 files changed, 9 insertions, 4 deletions
diff --git a/src/db/update/Service.cxx b/src/db/update/Service.cxx index d115fb5d9..f39cc76ea 100644 --- a/src/db/update/Service.cxx +++ b/src/db/update/Service.cxx @@ -151,7 +151,7 @@ UpdateService::StartThread(UpdateQueueItem &&i) modified = false; next = std::move(i); - walk = new UpdateWalk(GetEventLoop(), listener, *next.storage); + walk = new UpdateWalk(config, GetEventLoop(), listener, *next.storage); update_thread.Start(); diff --git a/src/db/update/Service.hxx b/src/db/update/Service.hxx index 5f90f7c0e..7fdfa4c7a 100644 --- a/src/db/update/Service.hxx +++ b/src/db/update/Service.hxx @@ -21,6 +21,7 @@ #define MPD_UPDATE_SERVICE_HXX #include "check.h" +#include "Config.hxx" #include "Queue.hxx" #include "event/DeferEvent.hxx" #include "thread/Thread.hxx" @@ -35,6 +36,8 @@ class CompositeStorage; * This class manages the update queue and runs the update thread. */ class UpdateService final { + const UpdateConfig config; + DeferEvent defer; SimpleDatabase &db; diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx index bab4fa456..2c8990cf3 100644 --- a/src/db/update/Walk.cxx +++ b/src/db/update/Walk.cxx @@ -49,9 +49,10 @@ #include <stdlib.h> #include <errno.h> -UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener, +UpdateWalk::UpdateWalk(const UpdateConfig &_config, + EventLoop &_loop, DatabaseListener &_listener, Storage &_storage) noexcept - :cancel(false), + :config(_config), cancel(false), storage(_storage), editor(_loop, _listener) { diff --git a/src/db/update/Walk.hxx b/src/db/update/Walk.hxx index a439ee00b..d16f5325e 100644 --- a/src/db/update/Walk.hxx +++ b/src/db/update/Walk.hxx @@ -56,7 +56,8 @@ class UpdateWalk final { DatabaseEditor editor; public: - UpdateWalk(EventLoop &_loop, DatabaseListener &_listener, + UpdateWalk(const UpdateConfig &_config, + EventLoop &_loop, DatabaseListener &_listener, Storage &_storage) noexcept; /** |