Code

aconnect: assign variable first, then start connect
[ncmpc.git] / src / callbacks.c
index dd5d15ba6cc1af9b5710be2972802d5761309ace..90eb40923001281ba7eb3a1d9936b8eb175f335d 100644 (file)
 #include "screen_utils.h"
 #include "screen_status.h"
 #include "mpdclient.h"
-#include "charset.h"
 
 static bool
-_screen_auth(struct mpdclient *c, gint recursion)
+_mpdclient_auth_callback(struct mpdclient *c, gint recursion)
 {
        struct mpd_connection *connection = mpdclient_get_connection(c);
        if (connection == NULL)
@@ -46,24 +45,21 @@ _screen_auth(struct mpdclient *c, gint recursion)
 
        if (mpd_connection_get_error(connection) == MPD_ERROR_SERVER &&
            mpd_connection_get_server_error(connection) == MPD_SERVER_ERROR_PASSWORD)
-               return  _screen_auth(c, ++recursion);
+               return _mpdclient_auth_callback(c, ++recursion);
 
        return true;
 }
 
 bool
-screen_auth(struct mpdclient *c)
+mpdclient_auth_callback(struct mpdclient *c)
 {
-       return _screen_auth(c, 0);
+       return _mpdclient_auth_callback(c, 0);
 }
 
 void
-mpdclient_ui_error(const char *message_utf8)
+mpdclient_error_callback(const char *message)
 {
-       char *message_locale = utf8_to_locale(message_utf8);
-       screen_status_printf("%s", message_locale);
-       g_free(message_locale);
-
+       screen_status_message(message);
        screen_bell();
        doupdate();
 }