aboutsummaryrefslogtreecommitdiffstats
path: root/src/Stats.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Stats.cxx')
-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;