From b76a29a69ae5412c3c1d101eefa9562990e74407 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 7 Aug 2013 19:54:38 +0200 Subject: ConfigPath: return a Path object Migrate all callers to use Path directly, instead of doing the conversion in each caller. --- src/db/SimpleDatabasePlugin.cxx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/db/SimpleDatabasePlugin.cxx') 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; } -- cgit v1.2.3