diff options
Diffstat (limited to 'calendar/pcs/cal-backend-file.c')
-rw-r--r-- | calendar/pcs/cal-backend-file.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c index 58879c8c3c..bda5f5f825 100644 --- a/calendar/pcs/cal-backend-file.c +++ b/calendar/pcs/cal-backend-file.c @@ -1200,10 +1200,15 @@ cal_backend_file_get_free_busy (CalBackend *backend, time_t start, time_t end) for (l = uids; l != NULL; l = l->next) { char *comp_str; icalcomponent *icalcomp; - icalproperty *icalprop; + icalproperty *icalprop, *prop; struct icalperiodtype ipt; char *uid = (char *) l->data; + /* FIXME: This looks quite inefficient. It is converting the + component to a string and then parsing it again. It would + be better to use lookup_component(). It needs to handle + timezones as well, so it is probably easier to use the + CalComponent wrapper functions. - Damon. */ comp_str = cal_backend_get_object (CAL_BACKEND (cbfile), uid); if (!comp_str) continue; @@ -1213,6 +1218,16 @@ cal_backend_file_get_free_busy (CalBackend *backend, time_t start, time_t end) if (!icalcomp) continue; + /* If the event is TRANSPARENT, skip it. */ + prop = icalcomponent_get_first_property (icalcomp, + ICAL_TRANSP_PROPERTY); + if (prop) { + const char *transp_val = icalproperty_get_transp (prop); + if (transp_val + && !strcasecmp (transp_val, "TRANSPARENT")) + continue; + } + ipt.start = icalcomponent_get_dtstart (icalcomp); ipt.end = icalcomponent_get_dtend (icalcomp); ipt.duration = icalcomponent_get_duration (icalcomp); |