about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-04-21 17:30:04 +0100
committerJames Booth <boothj5@gmail.com>2013-04-21 17:30:04 +0100
commit6ff5f45ad3fee853a53b9e91f88e40526e4dfa4d (patch)
treed3e84db83fb08331cc1efb1516e406da66cf207e /src/ui
parentb2c08cfc43966a69dc544db119ee615a20728a10 (diff)
downloadprofani-tty-6ff5f45ad3fee853a53b9e91f88e40526e4dfa4d.tar.gz
Moved static function in windows
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/windows.c84
1 files 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)
 {
@@ -1152,6 +1110,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)
 {