aboutsummaryrefslogtreecommitdiffstats
path: root/src/Stats.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/Stats.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 '')
-rw-r--r--src/Stats.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Stats.cxx b/src/Stats.cxx
index 354d26c59..0f9703674 100644
--- a/src/Stats.cxx
+++ b/src/Stats.cxx
@@ -29,6 +29,7 @@ extern "C" {
#include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx"
#include "DatabaseSimple.hxx"
+#include "util/Error.hxx"
struct stats stats;
@@ -44,19 +45,18 @@ void stats_global_finish(void)
void stats_update(void)
{
- GError *error = nullptr;
+ Error error;
DatabaseStats stats2;
const DatabaseSelection selection("", true);
- if (GetDatabase()->GetStats(selection, stats2, &error)) {
+ if (GetDatabase()->GetStats(selection, stats2, error)) {
stats.song_count = stats2.song_count;
stats.song_duration = stats2.total_duration;
stats.artist_count = stats2.artist_count;
stats.album_count = stats2.album_count;
} else {
- g_warning("%s", error->message);
- g_error_free(error);
+ g_warning("%s", error.GetMessage());
stats.song_count = 0;
stats.song_duration = 0;