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

@@ -57,8 +57,8 @@ SimpleDatabase::Configure(const config_param &param, 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 &param, 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;
}