[empathy] Expect the timestamp to be a int64
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Subject: [empathy] Expect the timestamp to be a int64
- Date: Wed, 27 May 2009 12:55:21 -0400 (EDT)
commit 3f1b321290d57754584f5d547f801c9cc6f04c75
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date: Sun Jan 25 23:07:04 2009 +1100
Expect the timestamp to be a int64
---
libempathy-gtk/empathy-contact-widget.c | 35 ++++++++++++++++---------------
1 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 30f1e4c..401a1db 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 || */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]