From cf198ce9b0834e4d2cf156f201c3fb77d17a1ce5 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Tue, 26 May 2009 12:27:25 -0400 Subject: Use empathy_time_to_string_local --- libempathy-gtk/empathy-contact-widget.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'libempathy-gtk/empathy-contact-widget.c') diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 5ccc4b009..9166a6546 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -21,10 +21,8 @@ #include -#define _GNU_SOURCE #include #include -#include #include #include @@ -41,6 +39,7 @@ #include #include #include +#include #include #include "empathy-contact-widget.h" @@ -1323,24 +1322,19 @@ contact_widget_location_update (EmpathyContactWidget *information) gtk_label_set_markup (GTK_LABEL (information->label_location), _("Location")); else { - gchar user_date [100]; + gchar *user_date; + gchar *text; gint64 stamp; - struct tm *ptm; time_t time; stamp = g_value_get_int64 (value); time = stamp; - ptm = gmtime (&time); - if (strftime (user_date, 100, _("%B %e, %Y at %R UTC"), ptm) > 0) - { - gchar *text; - text = g_strconcat ( _("Location on "), user_date, NULL); - gtk_label_set_markup (GTK_LABEL (information->label_location), text); - g_free (text); - } - else - gtk_label_set_markup (GTK_LABEL (information->label_location), _("Location")); + user_date = empathy_time_to_string_local (time, _("%B %e, %Y at %R")); + + text = g_strconcat ( _("Location on "), user_date, NULL); + gtk_label_set_markup (GTK_LABEL (information->label_location), text); + g_free (text); } if (information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP || -- cgit v1.2.3