diff options
author | James Booth <boothj5@gmail.com> | 2016-07-25 01:29:09 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-07-25 01:29:09 +0100 |
commit | 0ffb441cad3fe4c8af309be19e0ac85aa3444552 (patch) | |
tree | 82cc72e34540b92606e5124db1ddb48304f783a4 | |
parent | 33172cb917a6bfa3b2ed3b0a23bd29a126a03c2c (diff) | |
download | profani-tty-0ffb441cad3fe4c8af309be19e0ac85aa3444552.tar.gz |
Store GTimeZone in statusbar
fixes #785
-rw-r--r-- | src/ui/statusbar.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c index af165908..6a1a72e9 100644 --- a/src/ui/statusbar.c +++ b/src/ui/statusbar.c @@ -61,6 +61,7 @@ static int is_active[12]; static GHashTable *remaining_active; static int is_new[12]; static GHashTable *remaining_new; +static GTimeZone *tz; static GDateTime *last_time; static int current; @@ -95,10 +96,12 @@ create_status_bar(void) mvwprintw(status_bar, 0, cols - 34 + ((current - 1) * 3), bracket); wattroff(status_bar, bracket_attrs); + tz = g_time_zone_new_local(); + if (last_time) { g_date_time_unref(last_time); } - last_time = g_date_time_new_now_local(); + last_time = g_date_time_new_now(tz); _status_bar_draw(); } @@ -451,7 +454,7 @@ _status_bar_draw(void) if (last_time) { g_date_time_unref(last_time); } - last_time = g_date_time_new_now_local(); + last_time = g_date_time_new_now(tz); int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET); |