[evolution-data-server] Bug #655748 - rdate parsing failure: unknown value for period 20068



commit 756187c22835f255529e74a6ddc758b3e02dadea
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 3 12:02:49 2011 +0200

    Bug #655748 - rdate parsing failure: unknown value for period 20068

 calendar/libecal/e-cal-component.c |   15 +++++++++------
 calendar/libecal/e-cal-recur.c     |   10 ++++++----
 2 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c
index 04aff0f..2d3e60e 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -2774,8 +2774,10 @@ get_period_list (GSList *period_list,
 
 		p = g_new (ECalComponentPeriod, 1);
 
-		/* Get value parameter */
+		/* Get start and end/duration */
+		ip = (* get_prop_func) (period->prop);
 
+		/* Get value parameter */
 		if (period->value_param) {
 			icalparameter_value value_type;
 
@@ -2785,7 +2787,12 @@ get_period_list (GSList *period_list,
 				p->type = E_CAL_COMPONENT_PERIOD_DATETIME;
 			else if (value_type == ICAL_VALUE_DURATION)
 				p->type = E_CAL_COMPONENT_PERIOD_DURATION;
-			else {
+			else if (value_type == ICAL_VALUE_PERIOD) {
+				if (icaldurationtype_is_null_duration (ip.period.duration) || icaldurationtype_is_bad_duration (ip.period.duration))
+					p->type = E_CAL_COMPONENT_PERIOD_DATETIME;
+				else
+					p->type = E_CAL_COMPONENT_PERIOD_DURATION;
+			} else {
 				g_message ("get_period_list(): Unknown value for period %d; "
 					   "using DATETIME", value_type);
 				p->type = E_CAL_COMPONENT_PERIOD_DATETIME;
@@ -2793,10 +2800,6 @@ get_period_list (GSList *period_list,
 		} else
 			p->type = E_CAL_COMPONENT_PERIOD_DATETIME;
 
-		/* Get start and end/duration */
-
-		ip = (* get_prop_func) (period->prop);
-
 		p->start = ip.period.start;
 
 		if (p->type == E_CAL_COMPONENT_PERIOD_DATETIME)
diff --git a/calendar/libecal/e-cal-recur.c b/calendar/libecal/e-cal-recur.c
index 2392777..49df9e5 100644
--- a/calendar/libecal/e-cal-recur.c
+++ b/calendar/libecal/e-cal-recur.c
@@ -492,7 +492,7 @@ static void e_cal_recur_set_rule_end_date		(icalproperty	*prop,
 						 time_t		 end_date);
 
 #ifdef CAL_OBJ_DEBUG
-static gchar * cal_obj_time_to_string		(CalObjTime	*cotime);
+static const gchar * cal_obj_time_to_string		(CalObjTime	*cotime);
 #endif
 
 static ECalRecurVTable cal_obj_yearly_vtable = {
@@ -1433,7 +1433,9 @@ cal_object_get_rdate_end	(CalObjTime	*occ,
 
 	/* This should never happen. */
 	if (cmp == 0) {
-		g_warning ("Recurrence date not found");
+		#ifdef CAL_OBJ_DEBUG
+		g_debug ("%s: Recurrence date %s not found", G_STRFUNC, cal_obj_time_to_string (cc));
+		#endif
 		return FALSE;
 	}
 
@@ -3761,10 +3763,10 @@ cal_object_time_from_time	(CalObjTime	*cotime,
 /* Debugging function to convert a CalObjTime to a string. It uses a static
    buffer so beware. */
 #ifdef CAL_OBJ_DEBUG
-static gchar *
+static const gchar *
 cal_obj_time_to_string		(CalObjTime	*cotime)
 {
-	static gchar buffer[20];
+	static gchar buffer[50];
 	gchar *weekdays[] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
 			     "   " };
 	gint weekday;



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