diff options
author | Damon Chaplin <damon@ximian.com> | 2001-07-03 17:17:53 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-07-03 17:17:53 +0800 |
commit | 9dbf178166992b8e05679ae7a17a8058e5f8c8e6 (patch) | |
tree | 42202792cecd877d99ebf3245862b4fdabd14aa9 /libical/src | |
parent | a753b72a982b384b91a78ef91aa6088ca11c9824 (diff) | |
download | gsoc2013-evolution-9dbf178166992b8e05679ae7a17a8058e5f8c8e6.tar gsoc2013-evolution-9dbf178166992b8e05679ae7a17a8058e5f8c8e6.tar.gz gsoc2013-evolution-9dbf178166992b8e05679ae7a17a8058e5f8c8e6.tar.bz2 gsoc2013-evolution-9dbf178166992b8e05679ae7a17a8058e5f8c8e6.tar.lz gsoc2013-evolution-9dbf178166992b8e05679ae7a17a8058e5f8c8e6.tar.xz gsoc2013-evolution-9dbf178166992b8e05679ae7a17a8058e5f8c8e6.tar.zst gsoc2013-evolution-9dbf178166992b8e05679ae7a17a8058e5f8c8e6.zip |
add the icaltimezone to the timezone array of the toplevel VCALENDAR
2001-07-03 Damon Chaplin <damon@ximian.com>
* src/libical/icalcomponent.c (icalcomponent_add_component): add the
icaltimezone to the timezone array of the toplevel VCALENDAR component.
svn path=/trunk/; revision=10738
Diffstat (limited to 'libical/src')
-rw-r--r-- | libical/src/libical/icalcomponent.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libical/src/libical/icalcomponent.c b/libical/src/libical/icalcomponent.c index 6cf5c899fe..0cc294402a 100644 --- a/libical/src/libical/icalcomponent.c +++ b/libical/src/libical/icalcomponent.c @@ -128,6 +128,7 @@ icalcomponent_new_impl (icalcomponent_kind kind) comp->component_iterator = 0; comp->x_name = 0; comp->parent = 0; + /* FIXME: Probably only want to create this for VCALENDAR components. */ comp->timezones = icaltimezone_array_new (); return comp; @@ -553,13 +554,20 @@ icalcomponent_add_component (icalcomponent* parent, icalcomponent* child) icalerror_assert( (cimpl->parent ==0),"The child component has already been added to a parent component. Remove the component with icalcomponent_remove_component before calling icalcomponent_add_component"); + fprintf (stderr, "In icalcomponent_add_component\n"); + cimpl->parent = parent; pvl_push(impl->components,child); /* If the new component is a VTIMEZONE, add it to our array. */ - if (cimpl->kind == ICAL_VTIMEZONE_COMPONENT) - icaltimezone_array_append_from_vtimezone (cimpl->timezones, child); + if (cimpl->kind == ICAL_VTIMEZONE_COMPONENT) { + fprintf (stderr, " it is a VTIMEZONE component.\n"); + icaltimezone_array_append_from_vtimezone (impl->timezones, child); + + fprintf (stderr, " num timezones in array: %i\n", + impl->timezones->num_elements); + } } @@ -1767,6 +1775,7 @@ icaltimezone* icalcomponent_get_timezone(icalcomponent* comp, const char *tzid) struct icalcomponent_impl *impl; icaltimezone *zone; int lower, upper, middle, cmp; + char *zone_tzid; impl = (struct icalcomponent_impl*)comp; @@ -1774,10 +1783,14 @@ icaltimezone* icalcomponent_get_timezone(icalcomponent* comp, const char *tzid) lower = middle = 0; upper = impl->timezones->num_elements; + fprintf (stderr, "In icalcomponent_get_timezone (%i): %s\n", upper, tzid); + while (lower < upper) { middle = (lower + upper) >> 1; zone = icalarray_element_at (impl->timezones, middle); - cmp = strcmp (tzid, icaltimezone_get_tzid (zone)); + zone_tzid = icaltimezone_get_tzid (zone); + fprintf (stderr, " comparing with: %s\n", zone_tzid); + cmp = strcmp (tzid, zone_tzid); if (cmp == 0) return zone; else if (cmp < 0) |