diff options
author | Max Kellermann <max@duempel.org> | 2013-08-07 19:54:38 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-07 19:59:09 +0200 |
commit | b76a29a69ae5412c3c1d101eefa9562990e74407 (patch) | |
tree | 5c60aa1bb5e6a8d134707291d12fb4ebb77c06c8 /src/db | |
parent | abe090ec1f2255ce422f74e5b59bffc83aaff875 (diff) | |
download | mpd-b76a29a69ae5412c3c1d101eefa9562990e74407.tar.gz mpd-b76a29a69ae5412c3c1d101eefa9562990e74407.tar.xz mpd-b76a29a69ae5412c3c1d101eefa9562990e74407.zip |
ConfigPath: return a Path object
Migrate all callers to use Path directly, instead of doing the
conversion in each caller.
Diffstat (limited to '')
-rw-r--r-- | src/db/SimpleDatabasePlugin.cxx | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx index 7690a188b..373064c3f 100644 --- a/src/db/SimpleDatabasePlugin.cxx +++ b/src/db/SimpleDatabasePlugin.cxx @@ -57,8 +57,8 @@ SimpleDatabase::Configure(const config_param ¶m, GError **error_r) { GError *error = NULL; - char *_path = param.DupBlockPath("path", &error); - if (_path == NULL) { + path = param.GetBlockPath("path", &error); + if (path.IsNull()) { if (error != NULL) g_propagate_error(error_r, error); else @@ -67,16 +67,7 @@ SimpleDatabase::Configure(const config_param ¶m, GError **error_r) return false; } - path = Path::FromUTF8(_path); - path_utf8 = _path; - - free(_path); - - if (path.IsNull()) { - g_set_error(error_r, simple_db_quark(), 0, - "Failed to convert database path to FS encoding"); - return false; - } + path_utf8 = path.ToUTF8(); return true; } |