summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-02-28 11:53:38 +0100
committerMax Kellermann <max@duempel.org>2016-02-28 11:53:38 +0100
commitac15581c56e5ee6e7a3a576b1eb5444a8259ef80 (patch)
treea80635bd243dd278adacbf86744e087fe35a82da
parent9e2e8821579a6d7c5d36a4041a4223d3cde9d8fb (diff)
command/error: remove unused function print_playlist_result()
-rw-r--r--src/command/CommandError.cxx54
-rw-r--r--src/command/CommandError.hxx4
2 files changed, 1 insertions, 57 deletions
diff --git a/src/command/CommandError.cxx b/src/command/CommandError.cxx
index 4659a3f9a..71147835b 100644
--- a/src/command/CommandError.cxx
+++ b/src/command/CommandError.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "CommandError.hxx"
+#include "PlaylistError.hxx"
#include "db/DatabaseError.hxx"
#include "LocateUri.hxx"
#include "client/Response.hxx"
@@ -84,59 +85,6 @@ ToAck(DatabaseErrorCode code)
}
#endif
-CommandResult
-print_playlist_result(Response &r, PlaylistResult result)
-{
- switch (result) {
- case PlaylistResult::SUCCESS:
- return CommandResult::OK;
-
- case PlaylistResult::DENIED:
- r.Error(ACK_ERROR_PERMISSION, "Access denied");
- return CommandResult::ERROR;
-
- case PlaylistResult::NO_SUCH_SONG:
- r.Error(ACK_ERROR_NO_EXIST, "No such song");
- return CommandResult::ERROR;
-
- case PlaylistResult::NO_SUCH_LIST:
- r.Error(ACK_ERROR_NO_EXIST, "No such playlist");
- return CommandResult::ERROR;
-
- case PlaylistResult::LIST_EXISTS:
- r.Error(ACK_ERROR_EXIST, "Playlist already exists");
- return CommandResult::ERROR;
-
- case PlaylistResult::BAD_NAME:
- r.Error(ACK_ERROR_ARG,
- "playlist name is invalid: "
- "playlist names may not contain slashes,"
- " newlines or carriage returns");
- return CommandResult::ERROR;
-
- case PlaylistResult::BAD_RANGE:
- r.Error(ACK_ERROR_ARG, "Bad song index");
- return CommandResult::ERROR;
-
- case PlaylistResult::NOT_PLAYING:
- r.Error(ACK_ERROR_PLAYER_SYNC, "Not playing");
- return CommandResult::ERROR;
-
- case PlaylistResult::TOO_LARGE:
- r.Error(ACK_ERROR_PLAYLIST_MAX,
- "playlist is at the max size");
- return CommandResult::ERROR;
-
- case PlaylistResult::DISABLED:
- r.Error(ACK_ERROR_UNKNOWN,
- "stored playlist support is disabled");
- return CommandResult::ERROR;
- }
-
- assert(0);
- return CommandResult::ERROR;
-}
-
gcc_pure
static enum ack
ToAck(const Error &error)
diff --git a/src/command/CommandError.hxx b/src/command/CommandError.hxx
index debbb9e55..7c326484d 100644
--- a/src/command/CommandError.hxx
+++ b/src/command/CommandError.hxx
@@ -21,16 +21,12 @@
#define MPD_COMMAND_ERROR_HXX
#include "CommandResult.hxx"
-#include "PlaylistError.hxx"
#include <exception>
class Response;
class Error;
-CommandResult
-print_playlist_result(Response &r, PlaylistResult result);
-
/**
* Send the #Error to the client.
*/