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



commit e94ba4727f9febdbdb58cef8dbda8033a1439449
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 3 12:03:51 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 21f8f6f..51b060e 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -2775,8 +2775,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;
 
@@ -2786,7 +2788,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;
@@ -2794,10 +2801,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 ec76714..c941f18 100644
--- a/calendar/libecal/e-cal-recur.c
+++ b/calendar/libecal/e-cal-recur.c
@@ -493,7 +493,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 = {
@@ -1434,7 +1434,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;
 	}
 
@@ -3762,10 +3764,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]