ConfigPath: return a Path object

Migrate all callers to use Path directly, instead of doing the
conversion in each caller.
This commit is contained in:
Max Kellermann
2013-08-07 19:54:38 +02:00
parent abe090ec1f
commit b76a29a69a
19 changed files with 176 additions and 173 deletions

View File

@@ -23,6 +23,7 @@
#include "ConfigData.hxx"
#include "ConfigFile.hxx"
#include "ConfigPath.hxx"
#include "fs/Path.hxx"
#include "mpd_error.h"
#include <glib.h>
@@ -96,18 +97,18 @@ config_get_string(ConfigOption option, const char *default_value)
return param->value;
}
char *
config_dup_path(ConfigOption option, GError **error_r)
Path
config_get_path(ConfigOption option, GError **error_r)
{
assert(error_r != NULL);
assert(*error_r == NULL);
const struct config_param *param = config_get_param(option);
if (param == NULL)
return NULL;
return Path::Null();
char *path = parsePath(param->value, error_r);
if (G_UNLIKELY(path == NULL))
Path path = ParsePath(param->value, error_r);
if (gcc_unlikely(path.IsNull()))
g_prefix_error(error_r,
"Invalid path at line %i: ",
param->line);