util/Error: new error passing library

Replaces GLib's GError.
This commit is contained in:
Max Kellermann
2013-08-10 18:02:44 +02:00
parent c9fcc7f148
commit 29030b54c9
256 changed files with 3269 additions and 3371 deletions

View File

@@ -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;