From c9d28b69991560a049c9a482e74a0c9b24bd9b53 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 6 Apr 2014 01:14:21 +0100 Subject: [PATCH] Inlined status_bar_update_time --- src/ui/statusbar.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c index bbb3b781..4eacf992 100644 --- a/src/ui/statusbar.c +++ b/src/ui/statusbar.c @@ -48,7 +48,6 @@ static int dirty; static GDateTime *last_time; static int current; -static void _status_bar_update_time(void); static void _update_win_statuses(void); static void _mark_new(int num); static void _mark_active(int num); @@ -98,7 +97,18 @@ _status_bar_update_virtual(void) } if (dirty) { - _status_bar_update_time(); + gchar *date_fmt = g_date_time_format(last_time, "%H:%M"); + assert(date_fmt != NULL); + + wattron(status_bar, COLOUR_STATUS_BRACKET); + mvwaddch(status_bar, 0, 1, '['); + wattroff(status_bar, COLOUR_STATUS_BRACKET); + mvwprintw(status_bar, 0, 2, date_fmt); + wattron(status_bar, COLOUR_STATUS_BRACKET); + mvwaddch(status_bar, 0, 7, ']'); + wattroff(status_bar, COLOUR_STATUS_BRACKET); + g_free(date_fmt); + _update_win_statuses(); wnoutrefresh(status_bar); inp_put_back(); @@ -340,25 +350,6 @@ _status_bar_clear_message(void) dirty = TRUE; } -static void -_status_bar_update_time(void) -{ - gchar *date_fmt = g_date_time_format(last_time, "%H:%M"); - assert(date_fmt != NULL); - - wattron(status_bar, COLOUR_STATUS_BRACKET); - mvwaddch(status_bar, 0, 1, '['); - wattroff(status_bar, COLOUR_STATUS_BRACKET); - mvwprintw(status_bar, 0, 2, date_fmt); - wattron(status_bar, COLOUR_STATUS_BRACKET); - mvwaddch(status_bar, 0, 7, ']'); - wattroff(status_bar, COLOUR_STATUS_BRACKET); - - g_free(date_fmt); - - dirty = TRUE; -} - static void _update_win_statuses(void) {