Playlist: use the Error library to return errors

This commit is contained in:
Max Kellermann
2014-02-27 17:27:23 +01:00
parent 809b89b5af
commit 1c772ef699
9 changed files with 83 additions and 82 deletions

View File

@@ -23,7 +23,6 @@
#include "Interface.hxx"
#include "Partition.hxx"
#include "Instance.hxx"
#include "util/Error.hxx"
#include "DetachedSong.hxx"
#include <functional>
@@ -32,17 +31,12 @@ static bool
AddToQueue(Partition &partition, const LightSong &song, Error &error)
{
const Storage &storage = *partition.instance.storage;
PlaylistResult result =
unsigned id =
partition.playlist.AppendSong(partition.pc,
DatabaseDetachSong(storage,
song),
nullptr);
if (result != PlaylistResult::SUCCESS) {
error.Set(playlist_domain, int(result), "Playlist error");
return false;
}
return true;
error);
return id != 0;
}
bool