From 8877001a218f1dfd23a5ea9a98532144a4fffe93 Mon Sep 17 00:00:00 2001 From: Javier Fernandez Garcia-Boente Date: Thu, 19 Apr 2007 17:41:38 +0000 Subject: [PATCH] * Use strftime function instead of GDate to build string dates and time values. pmo-trunk-r1599 --- src/modest-text-utils.c | 11 +++++++---- src/widgets/modest-header-view-render.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index 96cd573..f411a1d 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -203,14 +203,17 @@ modest_text_utils_inline (const gchar *text, gsize modest_text_utils_strftime(char *s, gsize max, const char *fmt, time_t timet) { - static GDate date; + struct tm tm; +/* static GDate date; */ /* does not work on old maemo glib: * g_date_set_time_t (&date, timet); */ - g_date_set_time (&date, (GTime) timet); +/* g_date_set_time (&date, (GTime) timet); */ + localtime_r (&timet, &tm); - return g_date_strftime (s, max, fmt, (const GDate*) &date); +/* return g_date_strftime (s, max, fmt, (const GDate*) &date); */ + return strftime(s, max, fmt, &tm); } gchar * @@ -863,7 +866,7 @@ modest_text_utils_get_display_date (time_t date) /* if this is today, get the time instead of the date */ if (strcmp (date_buf, now_buf) == 0) - modest_text_utils_strftime (date_buf, BUF_SIZE, "%H:%M:%P", date); + modest_text_utils_strftime (date_buf, BUF_SIZE, "%H:%M %P", date); return g_strdup(date_buf); } diff --git a/src/widgets/modest-header-view-render.c b/src/widgets/modest-header-view-render.c index 2ae233a..3a0ad96 100644 --- a/src/widgets/modest-header-view-render.c +++ b/src/widgets/modest-header-view-render.c @@ -130,7 +130,7 @@ static void set_common_flags (GtkCellRenderer *renderer, TnyHeaderFlags flags) { g_object_set (G_OBJECT(renderer), - "weight", (flags & TNY_HEADER_FLAG_SEEN) ? 400: 800, + "weight", (flags & TNY_HEADER_FLAG_SEEN) ? PANGO_WEIGHT_NORMAL: PANGO_WEIGHT_ULTRABOLD, "strikethrough", (flags & TNY_HEADER_FLAG_DELETED) ? TRUE:FALSE, NULL); } -- 1.7.9.5