From d6e4b74802cdfb4336c20b3041a892186f9a3dc6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 1 Nov 2015 18:56:34 +0000 Subject: [PATCH] Removed ui_input_nonblocking() --- src/command/commands.c | 2 +- src/profanity.c | 2 +- src/ui/core.c | 6 ------ src/ui/inputwin.h | 1 - src/ui/ui.h | 2 +- src/ui/window.c | 4 ++-- src/xmpp/presence.c | 6 +++--- tests/unittests/ui/stub_ui.c | 4 ++-- 8 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/command/commands.c b/src/command/commands.c index 8a0787b8..5da5f3f8 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -4044,7 +4044,7 @@ cmd_inpblock(ProfWin *window, const char *const command, gchar **args) if (res) { cons_show("Input blocking set to %d milliseconds.", intval); prefs_set_inpblock(intval); - ui_input_nonblocking(FALSE); + inp_nonblocking(FALSE); } else { cons_show(err_msg); free(err_msg); diff --git a/src/profanity.c b/src/profanity.c index 07dcc332..28eb4bf4 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -340,7 +340,7 @@ _init(char *log_level) p_gpg_init(); #endif atexit(_shutdown); - ui_input_nonblocking(TRUE); + inp_nonblocking(TRUE); } static void diff --git a/src/ui/core.c b/src/ui/core.c index 2d925169..f5b365be 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -185,12 +185,6 @@ ui_close(void) endwin(); } -void -ui_input_nonblocking(gboolean reset) -{ - inp_nonblocking(reset); -} - void ui_resize(void) { diff --git a/src/ui/inputwin.h b/src/ui/inputwin.h index 8a2991f8..a5cbf23f 100644 --- a/src/ui/inputwin.h +++ b/src/ui/inputwin.h @@ -40,7 +40,6 @@ #define INP_WIN_MAX 1000 void create_input_window(void); -void inp_nonblocking(gboolean reset); void inp_close(void); void inp_win_resize(void); void inp_put_back(void); diff --git a/src/ui/ui.h b/src/ui/ui.h index ae44d921..0d53ee5e 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -86,6 +86,7 @@ void chatwin_contact_online(ProfChatWin *chatwin, Resource *resource, GDateTime void chatwin_contact_offline(ProfChatWin *chatwin, char *resource, char *status); char* inp_readline(void); +void inp_nonblocking(gboolean reset); void ui_handle_otr_error(const char *const barejid, const char *const message); @@ -226,7 +227,6 @@ void ui_update_presence(const resource_presence_t resource_presence, const char *const message, const char *const show); void ui_statusbar_new(const int win); -void ui_input_nonblocking(gboolean); void ui_write(char *line, int offset); void ui_invalid_command_usage(const char *const cmd, void (*setting_func)(void)); diff --git a/src/ui/window.c b/src/ui/window.c index 24baa63a..91e8b6c2 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -921,7 +921,7 @@ win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *time buffer_push(window->layout->buffer, show_char, pad_indent, timestamp, flags, theme_item, from, message, NULL); _win_print(window, show_char, pad_indent, timestamp, flags, theme_item, from, message, NULL); // TODO: cross-reference.. this should be replaced by a real event-based system - ui_input_nonblocking(TRUE); + inp_nonblocking(TRUE); g_date_time_unref(timestamp); } @@ -944,7 +944,7 @@ win_print_with_receipt(ProfWin *window, const char show_char, int pad_indent, GT buffer_push(window->layout->buffer, show_char, pad_indent, time, flags, theme_item, from, message, receipt); _win_print(window, show_char, pad_indent, time, flags, theme_item, from, message, receipt); // TODO: cross-reference.. this should be replaced by a real event-based system - ui_input_nonblocking(TRUE); + inp_nonblocking(TRUE); g_date_time_unref(time); } diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index 1cfa9e4e..e335dbff 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -486,7 +486,7 @@ static int _unavailable_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata) { - ui_input_nonblocking(TRUE); + inp_nonblocking(TRUE); const char *jid = xmpp_conn_get_jid(conn); char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM); @@ -563,7 +563,7 @@ static int _available_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata) { - ui_input_nonblocking(TRUE); + inp_nonblocking(TRUE); // handler still fires if error if (g_strcmp0(xmpp_stanza_get_type(stanza), STANZA_TYPE_ERROR) == 0) { @@ -662,7 +662,7 @@ _send_caps_request(char *node, char *caps_key, char *id, char *from) static int _muc_user_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata) { - ui_input_nonblocking(TRUE); + inp_nonblocking(TRUE); char *type = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_TYPE); char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM); diff --git a/tests/unittests/ui/stub_ui.c b/tests/unittests/ui/stub_ui.c index c60746d2..eaba66fc 100644 --- a/tests/unittests/ui/stub_ui.c +++ b/tests/unittests/ui/stub_ui.c @@ -314,9 +314,9 @@ char* inp_readline(void) return NULL; } -void ui_inp_history_append(char *inp) {} +void inp_nonblocking(gboolean reset) {} -void ui_input_nonblocking(gboolean reset) {} +void ui_inp_history_append(char *inp) {} void ui_invalid_command_usage(const char * const usage, void (*setting_func)(void)) {}