From 150443b014e3df20d9fcac0de88ff32574e4c471 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 17 Feb 2014 20:57:56 +0100 Subject: DatabasePlugin: add FLAG_REQUIRE_STORAGE Ignore the storage configuration if FLAG_REQUIRE_STORAGE is not set in the DatabasePlugin. --- src/storage/Configured.cxx | 6 ++++++ src/storage/Configured.hxx | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'src/storage') diff --git a/src/storage/Configured.cxx b/src/storage/Configured.cxx index ab0135935..29e511c7a 100644 --- a/src/storage/Configured.cxx +++ b/src/storage/Configured.cxx @@ -76,3 +76,9 @@ CreateConfiguredStorage(Error &error) return CreateConfiguredStorageLocal(error); } + +bool +IsStorageConfigured() +{ + return config_get_string(CONF_MUSIC_DIR, nullptr) != nullptr; +} diff --git a/src/storage/Configured.hxx b/src/storage/Configured.hxx index ec9621c64..d78857a26 100644 --- a/src/storage/Configured.hxx +++ b/src/storage/Configured.hxx @@ -21,6 +21,7 @@ #define MPD_STORAGE_CONFIG_HXX #include "check.h" +#include "Compiler.h" class Error; class Storage; @@ -33,4 +34,11 @@ class Storage; Storage * CreateConfiguredStorage(Error &error); +/** + * Returns true if there is configuration for a #Storage instance. + */ +gcc_const +bool +IsStorageConfigured(); + #endif -- cgit v1.2.3