Re: [evolution-patches] 56416



On Sat, 2004-04-03 at 00:19 -0500, JP Rosevear wrote:

> This was exposed fixing another bug where the backends wouldn't be told
> the timezones they needed.
> 


> +static ECalBackendSyncStatus
> +e_cal_backend_contacts_add_timezone (ECalBackendSync *backend,
> EDataCal *cal, const char *tzobj)
> +{
> +       ECalBackendContacts *cbcontacts;
> +       ECalBackendContactsPrivate *priv;
> +       icalcomponent *tz_comp;
> +
> +       cbcontacts = (ECalBackendContacts *) backend;
> +
> +       g_return_val_if_fail (E_IS_CAL_BACKEND_CONTACTS (cbcontacts),
> GNOME_Evolution_Calendar_OtherError);
> +       g_return_val_if_fail (tzobj != NULL,
> GNOME_Evolution_Calendar_OtherError);
> +
> +       priv = cbcontacts->priv;
> +
> +       tz_comp = icalparser_parse_string (tzobj);
> +       if (!tz_comp)
> +               return GNOME_Evolution_Calendar_InvalidObject;
> +
> +       if (icalcomponent_isa (tz_comp) == ICAL_VTIMEZONE_COMPONENT) {
> +               icaltimezone *zone;
> +               char *tzid;
> +               
> +               zone = icaltimezone_new ();
> +               icaltimezone_set_component (zone, tz_comp);
> +               tzid = icaltimezone_get_tzid (zone);
> +               
> +               g_hash_table_insert (priv->zones, g_strdup (tzid),
> zone);
> + 
shouldn't this check the timezone is not already on the hash table?

The rest looks ok

cheers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]