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;
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;
} 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)
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 = {
/* 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;
}
/* 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;