From d35c4d3229ab795af12b7a384f983b50608dee38 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 6 Feb 2001 21:11:37 +0000 Subject: If the categories string is empty, remove the property (get_period_list): 2001-02-06 JP Rosevear * cal-util/cal-component.c (cal_component_set_categories): If the categories string is empty, remove the property (get_period_list): Fixes from clahey to handle the new rdate format in libical (set_period_list): ditto svn path=/trunk/; revision=8023 --- calendar/ChangeLog | 8 ++++++++ calendar/cal-util/cal-component.c | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index f1f2a56241..a44200642a 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2001-02-06 JP Rosevear + + * cal-util/cal-component.c (cal_component_set_categories): If the + categories string is empty, remove the property + (get_period_list): Fixes from clahey to handle the new rdate + format in libical + (set_period_list): ditto + 2001-02-06 JP Rosevear * gui/event-editor.c (fill_reminder_widgets): Match new diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c index de7a768a17..26cb27e1bf 100644 --- a/calendar/cal-util/cal-component.c +++ b/calendar/cal-util/cal-component.c @@ -1166,7 +1166,7 @@ cal_component_set_categories (CalComponent *comp, const char *categories) priv = comp->priv; g_return_if_fail (priv->icalcomp != NULL); - if (!categories) { + if (!categories || !(*categories)) { if (priv->categories) { icalcomponent_remove_property (priv->icalcomp, priv->categories); icalproperty_free (priv->categories); @@ -1991,7 +1991,7 @@ cal_component_set_due (CalComponent *comp, CalComponentDateTime *dt) /* Builds a list of CalComponentPeriod structures based on a list of icalproperties */ static void get_period_list (GSList *period_list, - struct icalperiodtype (* get_prop_func) (icalproperty *prop), + struct icaldatetimeperiodtype (* get_prop_func) (icalproperty *prop), GSList **list) { GSList *l; @@ -2004,7 +2004,7 @@ get_period_list (GSList *period_list, for (l = period_list; l; l = l->next) { struct period *period; CalComponentPeriod *p; - struct icalperiodtype ip; + struct icaldatetimeperiodtype ip; period = l->data; g_assert (period->prop != NULL); @@ -2034,12 +2034,12 @@ get_period_list (GSList *period_list, ip = (* get_prop_func) (period->prop); - p->start = ip.start; + p->start = ip.period.start; if (p->type == CAL_COMPONENT_PERIOD_DATETIME) - p->u.end = ip.end; + p->u.end = ip.period.end; else if (p->type == CAL_COMPONENT_PERIOD_DURATION) - p->u.duration = ip.duration; + p->u.duration = ip.period.duration; else g_assert_not_reached (); @@ -2054,7 +2054,7 @@ get_period_list (GSList *period_list, /* Sets a period list value */ static void set_period_list (CalComponent *comp, - icalproperty *(* new_prop_func) (struct icalperiodtype period), + icalproperty *(* new_prop_func) (struct icaldatetimeperiodtype period), GSList **period_list, GSList *pl) { @@ -2084,7 +2084,7 @@ set_period_list (CalComponent *comp, for (l = pl; l; l = l->next) { CalComponentPeriod *p; struct period *period; - struct icalperiodtype ip; + struct icaldatetimeperiodtype ip; icalparameter_value value_type; g_assert (l->data != NULL); @@ -2092,14 +2092,14 @@ set_period_list (CalComponent *comp, /* Create libical value */ - ip.start = p->start; + ip.period.start = p->start; if (p->type == CAL_COMPONENT_PERIOD_DATETIME) { value_type = ICAL_VALUE_DATETIME; - ip.end = p->u.end; + ip.period.end = p->u.end; } else if (p->type == CAL_COMPONENT_PERIOD_DURATION) { value_type = ICAL_VALUE_DURATION; - ip.duration = p->u.duration; + ip.period.duration = p->u.duration; } else { g_assert_not_reached (); return; -- cgit v1.2.3