From 95e875ecf4b48f84fe6b9dd475669396a9609e20 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Mon, 17 Dec 2001 20:07:22 +0000 Subject: use get_real_item (get_refresh_options): uncomment out (get_real_item): 2001-12-17 JP Rosevear * gui/e-itip-control.c (send_item): use get_real_item (get_refresh_options): uncomment out (get_real_item): obtain the real object which has the uid of the item received (show_current_todo): use get_refresh_options for refresh method and provide the description and summary from the real component since its not in the reply (show_current_event): ditto (send_item): use get_real_item 2001-12-17 JP Rosevear * gui/itip-utils.c (comp_limit_attendees): can't remove properties in an iteration loop, so remove them outside the loop (comp_minimal): don't set a recurid if there isn't one, add the x properties to the clone (comp_compliant): unref the clone for DECLINECOUNTER * gui/e-itip-control.c (get_refresh_options): make function available again (show_current_event): use it here (ok_clicked_cb): can't remove properties in an iteration loop, so remove them outside the loop * cal-util/cal-component.c (free_icalcomponent): properly free the attendee list (cal_component_rescan): don't destroy the alarm hash svn path=/trunk/; revision=15136 --- calendar/gui/itip-utils.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'calendar/gui/itip-utils.c') diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 8eed74f42b..405240e9da 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -450,7 +450,8 @@ comp_limit_attendees (CalComponent *comp) GList *addresses; icalproperty *prop; gboolean found = FALSE, match = FALSE; - + GSList *l, *list = NULL; + icomp = cal_component_get_icalcomponent (comp); addresses = itip_addresses_get (); @@ -464,8 +465,7 @@ comp_limit_attendees (CalComponent *comp) /* If we've already found something, just erase the rest */ if (found) { - icalcomponent_remove_property (icomp, prop); - icalproperty_free (prop); + list = g_slist_prepend (list, prop); continue; } @@ -482,12 +482,20 @@ comp_limit_attendees (CalComponent *comp) if (strstr (text, a->address)) found = match = TRUE; } - if (!match) { - icalcomponent_remove_property (icomp, prop); - icalproperty_free (prop); - } + + if (!match) + list = g_slist_prepend (list, prop); match = FALSE; } + + for (l = list; l != NULL; l = l->next) { + prop = l->data; + + icalcomponent_remove_property (icomp, prop); + icalproperty_free (prop); + } + g_slist_free (list); + itip_addresses_free (addresses); return found; @@ -551,7 +559,7 @@ static CalComponent * comp_minimal (CalComponent *comp, gboolean attendee) { CalComponent *clone; - icalcomponent *icomp; + icalcomponent *icomp, *icomp_clone; icalproperty *prop; CalComponentOrganizer organizer; const char *uid; @@ -600,9 +608,11 @@ comp_minimal (CalComponent *comp, gboolean attendee) cal_component_free_text_list (comments); cal_component_get_recurid (comp, &recur_id); - cal_component_set_recurid (clone, recur_id); + if (recur_id->datetime->value != NULL) + cal_component_set_recurid (clone, recur_id); icomp = cal_component_get_icalcomponent (comp); + icomp_clone = cal_component_get_icalcomponent (clone); for (prop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY); prop != NULL; prop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY)) @@ -610,7 +620,7 @@ comp_minimal (CalComponent *comp, gboolean attendee) icalproperty *p; p = icalproperty_new_clone (prop); - icalcomponent_add_property (icomp, p); + icalcomponent_add_property (icomp_clone, p); } cal_component_rescan (clone); @@ -659,6 +669,7 @@ comp_compliant (CalComponentItipMethod method, CalComponent *comp) case CAL_COMPONENT_METHOD_DECLINECOUNTER: /* Need to remove almost everything */ temp_clone = comp_minimal (clone, FALSE); + gtk_object_unref (GTK_OBJECT (clone)); clone = temp_clone; break; default: -- cgit v1.2.3