summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Instance.cxx9
-rw-r--r--src/Instance.hxx4
-rw-r--r--src/Partition.cxx4
-rw-r--r--src/Partition.hxx2
-rw-r--r--src/SongLoader.cxx2
-rw-r--r--src/client/Client.cxx4
-rw-r--r--src/client/Client.hxx2
7 files changed, 10 insertions, 17 deletions
diff --git a/src/Instance.cxx b/src/Instance.cxx
index c7ceec229..a989b1f5d 100644
--- a/src/Instance.cxx
+++ b/src/Instance.cxx
@@ -35,15 +35,6 @@
#ifdef ENABLE_DATABASE
-Database *
-Instance::GetDatabase(Error &error)
-{
- if (database == nullptr)
- error.Set(db_domain, int(DatabaseErrorCode::DISABLED),
- "No database");
- return database;
-}
-
const Database &
Instance::GetDatabaseOrThrow() const
{
diff --git a/src/Instance.hxx b/src/Instance.hxx
index f5cada618..ed220b794 100644
--- a/src/Instance.hxx
+++ b/src/Instance.hxx
@@ -109,7 +109,9 @@ struct Instance final
* if this MPD configuration has no database (no
* music_directory was configured).
*/
- Database *GetDatabase(Error &error);
+ Database *GetDatabase() {
+ return database;
+ }
/**
* Returns the global #Database instance. Throws
diff --git a/src/Partition.cxx b/src/Partition.cxx
index c5df91e69..fba8d4dee 100644
--- a/src/Partition.cxx
+++ b/src/Partition.cxx
@@ -45,9 +45,9 @@ Partition::EmitIdle(unsigned mask)
#ifdef ENABLE_DATABASE
const Database *
-Partition::GetDatabase(Error &error) const
+Partition::GetDatabase() const
{
- return instance.GetDatabase(error);
+ return instance.GetDatabase();
}
const Database &
diff --git a/src/Partition.hxx b/src/Partition.hxx
index ec9478f9c..fb21fa69e 100644
--- a/src/Partition.hxx
+++ b/src/Partition.hxx
@@ -183,7 +183,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
* if this MPD configuration has no database (no
* music_directory was configured).
*/
- const Database *GetDatabase(Error &error) const;
+ const Database *GetDatabase() const;
gcc_pure
const Database &GetDatabaseOrThrow() const;
diff --git a/src/SongLoader.cxx b/src/SongLoader.cxx
index f2dae665a..a9868f52b 100644
--- a/src/SongLoader.cxx
+++ b/src/SongLoader.cxx
@@ -32,7 +32,7 @@
#ifdef ENABLE_DATABASE
SongLoader::SongLoader(const Client &_client)
- :client(&_client), db(_client.GetDatabase(IgnoreError())),
+ :client(&_client), db(_client.GetDatabase()),
storage(_client.GetStorage()) {}
#endif
diff --git a/src/client/Client.cxx b/src/client/Client.cxx
index d9e12fcfa..110f15c72 100644
--- a/src/client/Client.cxx
+++ b/src/client/Client.cxx
@@ -28,9 +28,9 @@ const Domain client_domain("client");
#ifdef ENABLE_DATABASE
const Database *
-Client::GetDatabase(Error &error) const
+Client::GetDatabase() const
{
- return partition.instance.GetDatabase(error);
+ return partition.instance.GetDatabase();
}
const Database &
diff --git a/src/client/Client.hxx b/src/client/Client.hxx
index 712824108..10411cb93 100644
--- a/src/client/Client.hxx
+++ b/src/client/Client.hxx
@@ -185,7 +185,7 @@ public:
* Wrapper for Instance::GetDatabase().
*/
gcc_pure
- const Database *GetDatabase(Error &error) const;
+ const Database *GetDatabase() const;
/**
* Wrapper for Instance::GetDatabaseOrThrow().