From 6ff5f45ad3fee853a53b9e91f88e40526e4dfa4d Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 21 Apr 2013 17:30:04 +0100 Subject: [PATCH] Moved static function in windows --- src/ui/windows.c | 84 ++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/ui/windows.c b/src/ui/windows.c index cf4ac35c..295619af 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -143,48 +143,6 @@ ui_refresh(void) inp_put_back(); } -static void -_ui_draw_win_title(void) -{ - char new_win_title[100]; - - GString *version_str = g_string_new(""); - - if (prefs_get_boolean(PREF_TITLEBARVERSION)) { - g_string_append(version_str, " "); - g_string_append(version_str, PACKAGE_VERSION); - if (strcmp(PACKAGE_STATUS, "development") == 0) { - g_string_append(version_str, "dev"); - } - } - - jabber_conn_status_t status = jabber_get_connection_status(); - - if (status == JABBER_CONNECTED) { - const char * const jid = jabber_get_jid(); - gint unread = _win_get_unread(); - - if (unread != 0) { - snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s (%d) - %s%c", '\033', "Profanity", version_str->str, unread, jid, '\007'); - } else { - snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s - %s%c", '\033', "Profanity", version_str->str, jid, '\007'); - } - } else { - snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s%c", '\033', "Profanity", version_str->str, '\007'); - } - - g_string_free(version_str, TRUE); - - if (g_strcmp0(win_title, new_win_title) != 0) { - // print to x-window title bar - printf("%s", new_win_title); - if (win_title != NULL) { - free(win_title); - } - win_title = strdup(new_win_title); - } -} - unsigned long ui_get_idle_time(void) { @@ -1151,6 +1109,48 @@ notify_remind(void) } } +static void +_ui_draw_win_title(void) +{ + char new_win_title[100]; + + GString *version_str = g_string_new(""); + + if (prefs_get_boolean(PREF_TITLEBARVERSION)) { + g_string_append(version_str, " "); + g_string_append(version_str, PACKAGE_VERSION); + if (strcmp(PACKAGE_STATUS, "development") == 0) { + g_string_append(version_str, "dev"); + } + } + + jabber_conn_status_t status = jabber_get_connection_status(); + + if (status == JABBER_CONNECTED) { + const char * const jid = jabber_get_jid(); + gint unread = _win_get_unread(); + + if (unread != 0) { + snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s (%d) - %s%c", '\033', "Profanity", version_str->str, unread, jid, '\007'); + } else { + snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s - %s%c", '\033', "Profanity", version_str->str, jid, '\007'); + } + } else { + snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s%c", '\033', "Profanity", version_str->str, '\007'); + } + + g_string_free(version_str, TRUE); + + if (g_strcmp0(win_title, new_win_title) != 0) { + // print to x-window title bar + printf("%s", new_win_title); + if (win_title != NULL) { + free(win_title); + } + win_title = strdup(new_win_title); + } +} + static void _notify(const char * const message, int timeout, const char * const category)