/** Iterate through components. */ icalcomponent *icalbdbset_get_current_component(icalset *set) { icalbdbset *bset = (icalbdbset *) set; icalerror_check_arg_rz((bset != 0), "bset"); return icalcomponent_get_current_component(bset->cluster); }
void delete_event(icalcomponent* calendar) { icalcomponent* event = find_event(calendar); if (!yes_no_prompt("Are you sure you want to delete this event? (y/n")) { return; } //Find the event in the components icalcomponent* c = icalcomponent_get_first_component(calendar, ICAL_VEVENT_COMPONENT); bool found_event = false; while((c=icalcomponent_get_current_component(c)) != 0 ) { if(icalcomponent_isa(c) == ICAL_VEVENT_COMPONENT) { if (c == event) { icalcomponent_remove_component(calendar, c); found_event = true; } }else { icalcomponent_get_next_component(calendar, ICAL_VEVENT_COMPONENT); } } if (!found_event) { append_action_to_closed_log("Delete event", false); return; } append_action_to_closed_log("Delete event", true); }
/** Iterate through components **/ icalcomponent *icalcluster_get_current_component(icalcluster* impl) { icalerror_check_arg_rz((impl!=0),"cluster"); return icalcomponent_get_current_component(impl->data); }