util/Error: new error passing library
Replaces GLib's GError.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user