* Use strftime function instead of GDate to build string
authorJavier Fernandez Garcia-Boente <jfernandez@igalia.com>
Thu, 19 Apr 2007 17:41:38 +0000 (17:41 +0000)
committerJavier Fernandez Garcia-Boente <jfernandez@igalia.com>
Thu, 19 Apr 2007 17:41:38 +0000 (17:41 +0000)
dates and time values.

pmo-trunk-r1599

src/modest-text-utils.c
src/widgets/modest-header-view-render.c

index 96cd573..f411a1d 100644 (file)
@@ -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);
 }
index 2ae233a..3a0ad96 100644 (file)
@@ -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);    
 }