config/Block: rename GetBlockPath() to GetPath()
This commit is contained in:
parent
f6f2a3b366
commit
d8bcdca55a
@ -91,8 +91,8 @@ ConfigBlock::GetBlockValue(const char *name, const char *default_value) const
|
||||
}
|
||||
|
||||
AllocatedPath
|
||||
ConfigBlock::GetBlockPath(const char *name, const char *default_value,
|
||||
Error &error) const
|
||||
ConfigBlock::GetPath(const char *name, const char *default_value,
|
||||
Error &error) const
|
||||
{
|
||||
assert(!error.IsDefined());
|
||||
|
||||
@ -119,9 +119,9 @@ ConfigBlock::GetBlockPath(const char *name, const char *default_value,
|
||||
}
|
||||
|
||||
AllocatedPath
|
||||
ConfigBlock::GetBlockPath(const char *name, Error &error) const
|
||||
ConfigBlock::GetPath(const char *name, Error &error) const
|
||||
{
|
||||
return GetBlockPath(name, nullptr, error);
|
||||
return GetPath(name, nullptr, error);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -112,10 +112,10 @@ struct ConfigBlock {
|
||||
* Same as config_get_path(), but looks up the setting in the
|
||||
* specified block.
|
||||
*/
|
||||
AllocatedPath GetBlockPath(const char *name, const char *default_value,
|
||||
Error &error) const;
|
||||
AllocatedPath GetPath(const char *name, const char *default_value,
|
||||
Error &error) const;
|
||||
|
||||
AllocatedPath GetBlockPath(const char *name, Error &error) const;
|
||||
AllocatedPath GetPath(const char *name, Error &error) const;
|
||||
|
||||
gcc_pure
|
||||
int GetBlockValue(const char *name, int default_value) const;
|
||||
|
@ -92,7 +92,7 @@ SimpleDatabase::Create(gcc_unused EventLoop &loop,
|
||||
bool
|
||||
SimpleDatabase::Configure(const ConfigBlock &block, Error &error)
|
||||
{
|
||||
path = block.GetBlockPath("path", error);
|
||||
path = block.GetPath("path", error);
|
||||
if (path.IsNull()) {
|
||||
if (!error.IsDefined())
|
||||
error.Set(simple_db_domain,
|
||||
@ -102,7 +102,7 @@ SimpleDatabase::Configure(const ConfigBlock &block, Error &error)
|
||||
|
||||
path_utf8 = path.ToUTF8();
|
||||
|
||||
cache_path = block.GetBlockPath("cache_directory", error);
|
||||
cache_path = block.GetPath("cache_directory", error);
|
||||
if (path.IsNull() && error.IsDefined())
|
||||
return false;
|
||||
|
||||
|
@ -86,7 +86,7 @@ sidplay_init(const ConfigBlock &block)
|
||||
{
|
||||
/* read the songlengths database file */
|
||||
Error error;
|
||||
const auto database_path = block.GetBlockPath("songlength_database", error);
|
||||
const auto database_path = block.GetPath("songlength_database", error);
|
||||
if (!database_path.IsNull())
|
||||
songlength_database = sidplay_load_songlength_db(database_path);
|
||||
else if (error.IsDefined())
|
||||
|
@ -42,9 +42,9 @@ wildmidi_init(const ConfigBlock &block)
|
||||
{
|
||||
Error error;
|
||||
const AllocatedPath path =
|
||||
block.GetBlockPath("config_file",
|
||||
"/etc/timidity/timidity.cfg",
|
||||
error);
|
||||
block.GetPath("config_file",
|
||||
"/etc/timidity/timidity.cfg",
|
||||
error);
|
||||
if (path.IsNull())
|
||||
FatalError(error);
|
||||
|
||||
|
@ -183,7 +183,7 @@ FifoOutput::Create(const ConfigBlock &block, Error &error)
|
||||
{
|
||||
FifoOutput *fd = new FifoOutput();
|
||||
|
||||
fd->path = block.GetBlockPath("path", error);
|
||||
fd->path = block.GetPath("path", error);
|
||||
if (fd->path.IsNull()) {
|
||||
delete fd;
|
||||
|
||||
|
@ -128,7 +128,7 @@ RecorderOutput::Configure(const ConfigBlock &block, Error &error)
|
||||
return false;
|
||||
}
|
||||
|
||||
path = block.GetBlockPath("path", error);
|
||||
path = block.GetPath("path", error);
|
||||
if (error.IsDefined())
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user