X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-text-utils.c;h=83de27d14ba458520d59e79c016e46bcf7f95bf2;hp=3e61cfc690ce3c488f63249e02132979ae58a6e0;hb=16d7f8b9f45217e350735e33ee6d0255aa894074;hpb=b35d93d9bf3b37ce2586f16d6e35cec5250221c3 diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index 3e61cfc..83de27d 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -1098,16 +1098,17 @@ modest_text_utils_utf8_strcmp (const gchar* s1, const gchar *s2, gboolean insens } -gchar* +const gchar* modest_text_utils_get_display_date (time_t date) { time_t now; - static const guint BUF_SIZE = 64; +#define DATE_BUF_SIZE 64 static const guint ONE_DAY = 24 * 60 * 60; /* seconds in one day */ - gchar date_buf[BUF_SIZE]; - gchar today_buf [BUF_SIZE]; + static gchar date_buf[DATE_BUF_SIZE]; + + gchar today_buf [DATE_BUF_SIZE]; - modest_text_utils_strftime (date_buf, BUF_SIZE, "%x", date); + modest_text_utils_strftime (date_buf, DATE_BUF_SIZE, "%x", date); now = time (NULL); @@ -1119,17 +1120,18 @@ modest_text_utils_get_display_date (time_t date) /* it's within the last 24 hours, but double check */ /* use the localized dates */ - modest_text_utils_strftime (today_buf, BUF_SIZE, "%x", now); + modest_text_utils_strftime (today_buf, DATE_BUF_SIZE, "%x", now); /* if it's today, use the time instead */ if (strcmp (date_buf, today_buf) == 0) - modest_text_utils_strftime (date_buf, BUF_SIZE, "%X", date); + modest_text_utils_strftime (date_buf, DATE_BUF_SIZE, "%X", date); } - return g_strdup(date_buf); + return date_buf; } + gboolean modest_text_utils_validate_folder_name (const gchar *folder_name) {