From 0c912990c773ece4e8dd5b868b86868661009cb7 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 21 Apr 2013 01:39:36 +0100 Subject: Moved cons_debug() to console module --- src/ui/console.c | 23 +++++++++++++++++++++++ src/ui/windows.c | 24 ------------------------ 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/ui/console.c b/src/ui/console.c index 57fd063f..812fbac1 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -71,6 +71,29 @@ cons_show_time(void) window_show_time(console, '-'); } +void +cons_debug(const char * const msg, ...) +{ + if (strcmp(PACKAGE_STATUS, "development") == 0) { + va_list arg; + va_start(arg, msg); + GString *fmt_msg = g_string_new(NULL); + g_string_vprintf(fmt_msg, msg, arg); + window_show_time(console, '-'); + wprintw(console->win, "%s\n", fmt_msg->str); + g_string_free(fmt_msg, TRUE); + va_end(arg); + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } + + win_current_page_off(); + ui_refresh(); + } +} + void cons_show(const char * const msg, ...) { diff --git a/src/ui/windows.c b/src/ui/windows.c index 52db5b2c..ce40eec9 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -1145,30 +1145,6 @@ win_room_show_status(const char * const contact) } } -void -cons_debug(const char * const msg, ...) -{ - if (strcmp(PACKAGE_STATUS, "development") == 0) { - va_list arg; - va_start(arg, msg); - GString *fmt_msg = g_string_new(NULL); - g_string_vprintf(fmt_msg, msg, arg); - window_show_time(console, '-'); - wprintw(console->win, "%s\n", fmt_msg->str); - g_string_free(fmt_msg, TRUE); - va_end(arg); - - if (current_index == 0) { - dirty = TRUE; - } else { - status_bar_new(0); - } - - win_current_page_off(); - ui_refresh(); - } -} - void cons_show_word(const char * const word) { -- cgit 1.4.1-2-gfad0