[gnome-calendar/ui-rewrite] utils: add print_date debug method



commit 1447ea8df1e78ca4a17e43952fa3a8d6c2e74b98
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Fri Sep 26 12:26:22 2014 -0400

    utils: add print_date debug method

 src/gcal-utils.c |   14 ++++++++++++++
 src/gcal-utils.h |    3 +++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-utils.c b/src/gcal-utils.c
index 1491da5..6c8ec17 100644
--- a/src/gcal-utils.c
+++ b/src/gcal-utils.c
@@ -22,6 +22,7 @@
 #include "gcal-event-widget.h"
 #include "gcal-view.h"
 
+#include <libecal/libecal.h>
 #include <libedataserver/libedataserver.h>
 
 #include <glib/gi18n.h>
@@ -278,6 +279,19 @@ gcal_compare_event_widget_by_date (gconstpointer a,
   return icaltime_compare (*a_date, *b_date);
 }
 
+void print_date (const gchar*        prefix,
+                 const icaltimetype* icaltime)
+{
+  gchar* temp =
+    isodate_from_time_t (icaltime_as_timet_with_zone (*icaltime,
+                                                      icaltime->zone));
+  g_debug ("%s: %s  --  zone: %s",
+           prefix,
+           temp,
+           icaltimezone_get_display_name (icaltime->zone));
+  g_free (temp);
+}
+
 /* Function to do a last minute fixup of the AM/PM stuff if the locale
  * and gettext haven't done it right. Most English speaking countries
  * except the USA use the 24 hour clock (UK, Australia etc). However
diff --git a/src/gcal-utils.h b/src/gcal-utils.h
index 598f5aa..b546151 100644
--- a/src/gcal-utils.h
+++ b/src/gcal-utils.h
@@ -73,6 +73,9 @@ GdkPixbuf*      gcal_get_pixbuf_from_color                      (GdkColor
 gint            gcal_compare_event_widget_by_date               (gconstpointer          a,
                                                                  gconstpointer          b);
 
+void            print_date                                      (const gchar*           prefix,
+                                                                 const icaltimetype*    icaltime);
+
 /* code brought from evolution */
 gsize           e_strftime_fix_am_pm                            (gchar                 *str,
                                                                  gsize                  max,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]