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/StickerDatabase.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/StickerDatabase.cxx') diff --git a/src/StickerDatabase.cxx b/src/StickerDatabase.cxx index 2d77e4b63..f153231de 100644 --- a/src/StickerDatabase.cxx +++ b/src/StickerDatabase.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "StickerDatabase.hxx" +#include "fs/Path.hxx" #include "Idle.hxx" #include @@ -104,21 +105,22 @@ sticker_prepare(const char *sql, GError **error_r) } bool -sticker_global_init(const char *path, GError **error_r) +sticker_global_init(Path &&path, GError **error_r) { int ret; - if (path == NULL) + if (path.IsNull()) /* not configured */ return true; /* open/create the sqlite database */ - ret = sqlite3_open(path, &sticker_db); + ret = sqlite3_open(path.c_str(), &sticker_db); if (ret != SQLITE_OK) { + const std::string utf8 = path.ToUTF8(); g_set_error(error_r, sticker_quark(), ret, "Failed to open sqlite database '%s': %s", - path, sqlite3_errmsg(sticker_db)); + utf8.c_str(), sqlite3_errmsg(sticker_db)); return false; } -- cgit v1.2.3