[evolution-patches] patch for #43388
- From: Rodrigo Moya <rodrigo ximian com>
- To: Evolution Patches <evolution-patches ximian com>
- Subject: [evolution-patches] patch for #43388
- Date: 02 Jun 2003 20:54:34 +0200
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1787
diff -u -p -r1.1787 ChangeLog
--- ChangeLog 2 Jun 2003 14:19:27 -0000 1.1787
+++ ChangeLog 2 Jun 2003 17:16:15 -0000
@@ -1,3 +1,11 @@
+2003-06-02 Rodrigo Moya <rodrigo ximian com>
+
+ Fixes part of #43388
+
+ * importers/icalendar-importer.c (prepare_events):
+ (prepare_tasks): use external iterators for removing components from
+ the main component.
+
2003-05-29 Rodrigo Moya <rodrigo ximian com>
Fixes #43763
Index: importers/icalendar-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/importers/icalendar-importer.c,v
retrieving revision 1.19
diff -u -p -r1.19 icalendar-importer.c
--- importers/icalendar-importer.c 2 Apr 2003 16:58:12 -0000 1.19
+++ importers/icalendar-importer.c 2 Jun 2003 17:16:15 -0000
@@ -127,25 +127,24 @@ read_file (const char *filename)
static GList*
prepare_events (icalcomponent *icalcomp)
{
- icalcomponent *subcomp, *next_subcomp;
+ icalcomponent *subcomp;
GList *vtodos = NULL;
+ icalcompiter iter;
- subcomp = icalcomponent_get_first_component (icalcomp,
- ICAL_ANY_COMPONENT);
- while (subcomp) {
+ iter = icalcomponent_begin_component (icalcomp, ICAL_ANY_COMPONENT);
+ while ((subcomp = icalcompiter_deref (&iter)) != NULL) {
icalcomponent_kind child_kind = icalcomponent_isa (subcomp);
- next_subcomp = icalcomponent_get_next_component (icalcomp, ICAL_ANY_COMPONENT);
if (child_kind != ICAL_VEVENT_COMPONENT
&& child_kind != ICAL_VTIMEZONE_COMPONENT) {
- icalcomponent_remove_component (icalcomp,
- subcomp);
+ icalcomponent_remove_component (icalcomp, subcomp);
if (child_kind == ICAL_VTODO_COMPONENT)
vtodos = g_list_prepend (vtodos, subcomp);
else
icalcomponent_free (subcomp);
}
- subcomp = next_subcomp;
+
+ icalcompiter_next (&iter);
}
return vtodos;
@@ -158,20 +157,20 @@ prepare_events (icalcomponent *icalcomp)
static void
prepare_tasks (icalcomponent *icalcomp, GList *vtodos)
{
- icalcomponent *subcomp, *next_subcomp;
+ icalcomponent *subcomp;
GList *elem;
+ icalcompiter iter;
- subcomp = icalcomponent_get_first_component (icalcomp,
- ICAL_ANY_COMPONENT);
- while (subcomp) {
+ iter = icalcomponent_begin_component (icalcomp, ICAL_ANY_COMPONENT);
+ while ((subcomp = icalcompiter_deref (&iter)) != NULL) {
icalcomponent_kind child_kind = icalcomponent_isa (subcomp);
- next_subcomp = icalcomponent_get_next_component (icalcomp, ICAL_ANY_COMPONENT);
if (child_kind != ICAL_VTODO_COMPONENT
&& child_kind != ICAL_VTIMEZONE_COMPONENT) {
icalcomponent_remove_component (icalcomp, subcomp);
icalcomponent_free (subcomp);
}
- subcomp = next_subcomp;
+
+ icalcompiter_next (&iter);
}
for (elem = vtodos; elem; elem = elem->next) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]