diff options
author | Max Kellermann <max@duempel.org> | 2013-08-10 18:02:44 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-04 18:14:22 +0200 |
commit | 29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch) | |
tree | 79766830b55ebca38ddbce84d8d548227eedb69e /src/PlaylistDatabase.cxx | |
parent | c9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff) |
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to 'src/PlaylistDatabase.cxx')
-rw-r--r-- | src/PlaylistDatabase.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/PlaylistDatabase.cxx b/src/PlaylistDatabase.cxx index c5cfc8397..690845a68 100644 --- a/src/PlaylistDatabase.cxx +++ b/src/PlaylistDatabase.cxx @@ -22,15 +22,13 @@ #include "PlaylistVector.hxx" #include "TextFile.hxx" #include "util/StringUtil.hxx" +#include "util/Error.hxx" +#include "util/Domain.hxx" #include <string.h> #include <stdlib.h> -static GQuark -playlist_database_quark(void) -{ - return g_quark_from_static_string("playlist_database"); -} +static constexpr Domain playlist_database_domain("playlist_database"); void playlist_vector_save(FILE *fp, const PlaylistVector &pv) @@ -44,7 +42,7 @@ playlist_vector_save(FILE *fp, const PlaylistVector &pv) bool playlist_metadata_load(TextFile &file, PlaylistVector &pv, const char *name, - GError **error_r) + Error &error) { PlaylistInfo pm(name, 0); @@ -55,8 +53,8 @@ playlist_metadata_load(TextFile &file, PlaylistVector &pv, const char *name, strcmp(line, "playlist_end") != 0) { colon = strchr(line, ':'); if (colon == NULL || colon == line) { - g_set_error(error_r, playlist_database_quark(), 0, - "unknown line in db: %s", line); + error.Format(playlist_database_domain, + "unknown line in db: %s", line); return false; } @@ -66,8 +64,8 @@ playlist_metadata_load(TextFile &file, PlaylistVector &pv, const char *name, if (strcmp(line, "mtime") == 0) pm.mtime = strtol(value, NULL, 10); else { - g_set_error(error_r, playlist_database_quark(), 0, - "unknown line in db: %s", line); + error.Format(playlist_database_domain, + "unknown line in db: %s", line); return false; } } |