From cf6281a5a758e4b93d67f7fd5804a8cff60ddbf9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 1 Feb 2014 00:26:34 +0100 Subject: Instance: add Database attribute Move from db/DatabaseGlue.cxx, eliminating global variable. --- src/StateFile.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/StateFile.cxx') diff --git a/src/StateFile.cxx b/src/StateFile.cxx index 6c01be53c..e46af1c3e 100644 --- a/src/StateFile.cxx +++ b/src/StateFile.cxx @@ -23,9 +23,9 @@ #include "PlaylistState.hxx" #include "fs/TextFile.hxx" #include "Partition.hxx" +#include "Instance.hxx" #include "mixer/Volume.hxx" #include "SongLoader.hxx" -#include "db/DatabaseGlue.hxx" #include "fs/FileSystem.hxx" #include "util/Domain.hxx" #include "Log.hxx" @@ -98,7 +98,11 @@ StateFile::Read() return; } - const SongLoader song_loader(nullptr, GetDatabase()); +#ifdef ENABLE_DATABASE + const SongLoader song_loader(partition.instance.database); +#else + const SongLoader song_loader(nullptr); +#endif const char *line; while ((line = file.ReadLine()) != NULL) { -- cgit v1.2.3