aboutsummaryrefslogtreecommitdiffstats
path: root/src/DatabasePrint.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-10 18:02:44 +0200
committerMax Kellermann <max@duempel.org>2013-09-04 18:14:22 +0200
commit29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch)
tree79766830b55ebca38ddbce84d8d548227eedb69e /src/DatabasePrint.cxx
parentc9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff)
downloadmpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to 'src/DatabasePrint.cxx')
-rw-r--r--src/DatabasePrint.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/DatabasePrint.cxx b/src/DatabasePrint.cxx
index 1f8999dc3..cc7bee9e2 100644
--- a/src/DatabasePrint.cxx
+++ b/src/DatabasePrint.cxx
@@ -118,9 +118,9 @@ PrintPlaylistFull(Client *client,
bool
db_selection_print(Client *client, const DatabaseSelection &selection,
- bool full, GError **error_r)
+ bool full, Error &error)
{
- const Database *db = GetDatabase(error_r);
+ const Database *db = GetDatabase(error);
if (db == nullptr)
return false;
@@ -136,7 +136,7 @@ db_selection_print(Client *client, const DatabaseSelection &selection,
client, _1, _2)
: VisitPlaylist();
- return db->Visit(selection, d, s, p, error_r);
+ return db->Visit(selection, d, s, p, error);
}
struct SearchStats {
@@ -162,9 +162,9 @@ stats_visitor_song(SearchStats &stats, Song &song)
bool
searchStatsForSongsIn(Client *client, const char *name,
const SongFilter *filter,
- GError **error_r)
+ Error &error)
{
- const Database *db = GetDatabase(error_r);
+ const Database *db = GetDatabase(error);
if (db == nullptr)
return false;
@@ -177,7 +177,7 @@ searchStatsForSongsIn(Client *client, const char *name,
using namespace std::placeholders;
const auto f = std::bind(stats_visitor_song, std::ref(stats),
_1);
- if (!db->Visit(selection, f, error_r))
+ if (!db->Visit(selection, f, error))
return false;
printSearchStats(client, &stats);
@@ -185,18 +185,18 @@ searchStatsForSongsIn(Client *client, const char *name,
}
bool
-printAllIn(Client *client, const char *uri_utf8, GError **error_r)
+printAllIn(Client *client, const char *uri_utf8, Error &error)
{
const DatabaseSelection selection(uri_utf8, true);
- return db_selection_print(client, selection, false, error_r);
+ return db_selection_print(client, selection, false, error);
}
bool
printInfoForAllIn(Client *client, const char *uri_utf8,
- GError **error_r)
+ Error &error)
{
const DatabaseSelection selection(uri_utf8, true);
- return db_selection_print(client, selection, true, error_r);
+ return db_selection_print(client, selection, true, error);
}
static bool
@@ -218,9 +218,9 @@ PrintUniqueTag(Client *client, enum tag_type tag_type,
bool
listAllUniqueTags(Client *client, int type,
const SongFilter *filter,
- GError **error_r)
+ Error &error)
{
- const Database *db = GetDatabase(error_r);
+ const Database *db = GetDatabase(error);
if (db == nullptr)
return false;
@@ -229,12 +229,12 @@ listAllUniqueTags(Client *client, int type,
if (type == LOCATE_TAG_FILE_TYPE) {
using namespace std::placeholders;
const auto f = std::bind(PrintSongURIVisitor, client, _1);
- return db->Visit(selection, f, error_r);
+ return db->Visit(selection, f, error);
} else {
using namespace std::placeholders;
const auto f = std::bind(PrintUniqueTag, client,
(enum tag_type)type, _1);
return db->VisitUniqueTags(selection, (enum tag_type)type,
- f, error_r);
+ f, error);
}
}