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/StickerDatabase.cxx | |
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/StickerDatabase.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
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 <string> @@ -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; } |