summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dfc94ef)
raw | patch | inline | side by side (parent: dfc94ef)
author | Max Kellermann <max@duempel.org> | |
Tue, 29 Sep 2009 16:20:33 +0000 (18:20 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 29 Sep 2009 16:20:33 +0000 (18:20 +0200) |
libmpdclient2 discards the command name from the error message, we
don't need to do it again.
don't need to do it again.
src/main.c | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index 398a46f78af3239b6a5f6c61190401433c66d056..10706a55456b5e4dfc914d7c1dca3bbfcbe2b57d 100644 (file)
--- a/src/main.c
+++ b/src/main.c
static guint check_key_bindings_source_id;
#endif
-static const gchar *
-error_msg(const gchar *msg)
-{
- gchar *p;
-
- if ((p = strchr(msg, '}')) == NULL)
- return msg;
-
- do {
- p++;
- } while (*p == '}' || * p== ' ');
-
- return p;
-}
-
static void
-error_callback(G_GNUC_UNUSED struct mpdclient *c, gint error, const gchar *_msg)
+error_callback(G_GNUC_UNUSED struct mpdclient *c, G_GNUC_UNUSED gint error,
+ const gchar *_msg)
{
char *msg = utf8_to_locale(_msg);
-
- error = error & 0xFF;
- switch (error) {
- case MPD_ERROR_SERVER:
- screen_status_printf("%s", error_msg(msg));
- screen_bell();
- break;
- default:
- screen_status_printf("%s", msg);
- screen_bell();
- doupdate();
- }
-
+ screen_status_printf("%s", msg);
g_free(msg);
+
+ screen_bell();
+ doupdate();
}
#ifndef NCMPC_MINI