diff options
Diffstat (limited to 'libical/src')
-rw-r--r-- | libical/src/libical/icalcomponent.c | 2 | ||||
-rw-r--r-- | libical/src/libical/icaltimezone.c | 22 |
2 files changed, 15 insertions, 9 deletions
diff --git a/libical/src/libical/icalcomponent.c b/libical/src/libical/icalcomponent.c index a9ce7537b8..fa97c59f9c 100644 --- a/libical/src/libical/icalcomponent.c +++ b/libical/src/libical/icalcomponent.c @@ -573,6 +573,8 @@ icalcomponent_add_component (icalcomponent* parent, icalcomponent* child) if (cimpl->kind == ICAL_VTIMEZONE_COMPONENT) { fprintf (stderr, " it is a VTIMEZONE component.\n"); + /* FIXME: Currently we are also creating this array when loading in + a builtin VTIMEZONE, when we don't need it. */ if (!impl->timezones) impl->timezones = icaltimezone_array_new (); diff --git a/libical/src/libical/icaltimezone.c b/libical/src/libical/icaltimezone.c index 91f72470c7..eb2392414f 100644 --- a/libical/src/libical/icaltimezone.c +++ b/libical/src/libical/icaltimezone.c @@ -308,6 +308,8 @@ icaltimezone_get_location_from_vtimezone (icalcomponent *component) prop = icalcomponent_get_next_property (component, ICAL_X_PROPERTY); } + + return NULL; } @@ -881,8 +883,10 @@ icaltimezone_get_utc_offset (icaltimezone *zone, standard time instead. */ want_daylight = (tt->is_daylight == 1) ? 1 : 0; +#if 0 if (zone_change->is_daylight == prev_zone_change->is_daylight) printf (" **** Same is_daylight setting\n"); +#endif if (zone_change->is_daylight != want_daylight && prev_zone_change->is_daylight == want_daylight) @@ -1143,9 +1147,8 @@ icaltimezone_get_tzid (icaltimezone *zone) char* icaltimezone_get_location (icaltimezone *zone) { - if (!zone->component) - icaltimezone_load_builtin_timezone (zone); - + /* Note that for builtin timezones this comes from zones.tab so we don't + need to check the timezone is loaded here. */ return zone->location; } @@ -1164,9 +1167,8 @@ icaltimezone_get_tznames (icaltimezone *zone) double icaltimezone_get_latitude (icaltimezone *zone) { - if (!zone->component) - icaltimezone_load_builtin_timezone (zone); - + /* Note that for builtin timezones this comes from zones.tab so we don't + need to check the timezone is loaded here. */ return zone->latitude; } @@ -1175,9 +1177,8 @@ icaltimezone_get_latitude (icaltimezone *zone) double icaltimezone_get_longitude (icaltimezone *zone) { - if (!zone->component) - icaltimezone_load_builtin_timezone (zone); - + /* Note that for builtin timezones this comes from zones.tab so we don't + need to check the timezone is loaded here. */ return zone->longitude; } @@ -1310,6 +1311,9 @@ icaltimezone_get_builtin_timezone_from_tzid (const char *tzid) fprintf (stderr, "Getting builtin timezone from TZID: %s\n", tzid); + if (!tzid || !tzid[0]) + return NULL; + /* Check that the TZID starts with our unique prefix. */ if (strncmp (tzid, TZID_PREFIX, TZID_PREFIX_LEN)) return NULL; |