diff options
author | Max Kellermann <max@duempel.org> | 2014-02-04 08:37:05 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-04 09:05:32 +0100 |
commit | d76b6f878e06d052ab54415783c39997939349e0 (patch) | |
tree | 954eb15c6a1f8eaa033285df551f355f6973d758 /src/db/update/UpdateGlue.cxx | |
parent | f25ef8d6825c03aec4569c6ad4b9bfb3a9f5d78d (diff) | |
download | mpd-d76b6f878e06d052ab54415783c39997939349e0.tar.gz mpd-d76b6f878e06d052ab54415783c39997939349e0.tar.xz mpd-d76b6f878e06d052ab54415783c39997939349e0.zip |
db/update/Service: add SimpleDatabase reference
Don't use the global variables from the DatabaseSimple library.
Diffstat (limited to 'src/db/update/UpdateGlue.cxx')
-rw-r--r-- | src/db/update/UpdateGlue.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/db/update/UpdateGlue.cxx b/src/db/update/UpdateGlue.cxx index 742fbfe98..a13d56926 100644 --- a/src/db/update/UpdateGlue.cxx +++ b/src/db/update/UpdateGlue.cxx @@ -20,7 +20,7 @@ #include "config.h" #include "Service.hxx" #include "UpdateDomain.hxx" -#include "db/DatabaseSimple.hxx" +#include "db/plugins/SimpleDatabasePlugin.hxx" #include "Idle.hxx" #include "util/Error.hxx" #include "Log.hxx" @@ -44,12 +44,12 @@ UpdateService::Task() SetThreadIdlePriority(); - modified = walk.Walk(*db_get_root(), next.path_utf8.c_str(), + modified = walk.Walk(*db.GetRoot(), next.path_utf8.c_str(), next.discard); - if (modified || !db_exists()) { + if (modified || !db.FileExists()) { Error error; - if (!db_save(error)) + if (!db.Save(error)) LogError(error, "Failed to save database"); } @@ -146,8 +146,7 @@ UpdateService::RunDeferred() } } -UpdateService::UpdateService(EventLoop &_loop) - :DeferredMonitor(_loop), walk(_loop) +UpdateService::UpdateService(EventLoop &_loop, SimpleDatabase &_db) + :DeferredMonitor(_loop), db(_db), walk(_loop) { - assert(db_is_simple()); } |