aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-01-25 20:07:04 +0800
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-28 00:52:05 +0800
commit3f1b321290d57754584f5d547f801c9cc6f04c75 (patch)
treee0512d49b4feeac524586ca4ffb7dc8a0ae6fd22
parentf84dfa1e04ea5283d09ca03dd9416a93f005b5fb (diff)
downloadgsoc2013-empathy-3f1b321290d57754584f5d547f801c9cc6f04c75.tar
gsoc2013-empathy-3f1b321290d57754584f5d547f801c9cc6f04c75.tar.gz
gsoc2013-empathy-3f1b321290d57754584f5d547f801c9cc6f04c75.tar.bz2
gsoc2013-empathy-3f1b321290d57754584f5d547f801c9cc6f04c75.tar.lz
gsoc2013-empathy-3f1b321290d57754584f5d547f801c9cc6f04c75.tar.xz
gsoc2013-empathy-3f1b321290d57754584f5d547f801c9cc6f04c75.tar.zst
gsoc2013-empathy-3f1b321290d57754584f5d547f801c9cc6f04c75.zip
Expect the timestamp to be a int64
-rw-r--r--libempathy-gtk/empathy-contact-widget.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 30f1e4c25..401a1db3a 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -1264,23 +1264,24 @@ contact_widget_location_update (EmpathyContactWidget *information)
gtk_label_set_markup (GTK_LABEL (information->label_location), _("<b>Location</b>"));
else
{
- const gchar *str_date = g_value_get_string (value);
- struct tm * ptm = g_new0 (struct tm, 1);
-
- gchar * p = strptime (str_date, "%Y%m%dT%T", ptm);
- if (p != NULL)
- {
- gchar *text;
- gchar user_date [100];
- if (strftime (user_date, 100, _("%B %e, %Y at %R UTC"), ptm) > 0)
- {
- text = g_strconcat ( _("<b>Location</b> 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), _("<b>Location</b>"));
- }
+ gchar user_date [100];
+ 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 ( _("<b>Location</b> 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), _("<b>Location</b>"));
}
if (/* information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP || */