# HG changeset patch # User Mikael Berthe # Date 1404655767 -7200 # Node ID 1b3add57c912e4e61ec440a29152040900699d37 # Parent 7a0df2e5da1921eb788502bc0f8dc020cea50805 Try to display the GLib warnings in the log window diff -r 7a0df2e5da19 -r 1b3add57c912 mcabber/mcabber/screen.c --- a/mcabber/mcabber/screen.c Sun Jul 06 15:48:27 2014 +0200 +++ b/mcabber/mcabber/screen.c Sun Jul 06 16:09:27 2014 +0200 @@ -86,6 +86,9 @@ static void scr_insert_text(const char*); static void scr_handle_tab(gboolean fwd); +static void scr_glog_print(const gchar *log_domain, GLogLevelFlags log_level, + const gchar *message, gpointer user_data); + #if defined XEP0022 || defined XEP0085 static gboolean scr_chatstates_timeout(); #endif @@ -828,6 +831,8 @@ ptr_inputline = inputLine; Curses = TRUE; + + g_log_set_handler("GLib", G_LOG_LEVEL_MASK, scr_glog_print, NULL); return; } @@ -993,6 +998,13 @@ g_free(btext); } +// This is a GLogFunc for Glib log messages +static void scr_glog_print(const gchar *log_domain, GLogLevelFlags log_level, + const gchar *message, gpointer user_data) +{ + scr_log_print(LPRINT_NORMAL, "[%s] %s", log_domain, message); +} + static winbuf *scr_search_window(const char *winId, int special) { char *id;