extract_timezones (ECalBackendCalDAV *cbdav,
icalcomponent *icomp)
{
+ ETimezoneCache *timezone_cache;
GSList *timezones = NULL, *iter;
icaltimezone *zone;
GError *err = NULL;
g_return_val_if_fail (cbdav != NULL, FALSE);
g_return_val_if_fail (icomp != NULL, FALSE);
+ timezone_cache = E_TIMEZONE_CACHE (cbdav);
+
extract_objects (icomp, ICAL_VTIMEZONE_COMPONENT, &timezones, &err);
if (err) {
g_error_free (err);
zone = icaltimezone_new ();
for (iter = timezones; iter; iter = iter->next) {
if (icaltimezone_set_component (zone, iter->data)) {
- e_cal_backend_store_put_timezone (cbdav->priv->store, zone);
+ e_timezone_cache_add_timezone (timezone_cache, zone);
} else {
icalcomponent_free (iter->data);
}
const gchar *tzobj,
GError **error)
{
- icalcomponent *tz_comp;
+ ETimezoneCache *timezone_cache;
ECalBackendCalDAV *cbdav;
+ icalcomponent *tz_comp;
cbdav = E_CAL_BACKEND_CALDAV (backend);
+ timezone_cache = E_TIMEZONE_CACHE (backend);
e_return_data_cal_error_if_fail (E_IS_CAL_BACKEND_CALDAV (cbdav), InvalidArg);
e_return_data_cal_error_if_fail (tzobj != NULL, InvalidArg);
zone = icaltimezone_new ();
icaltimezone_set_component (zone, tz_comp);
- e_cal_backend_store_put_timezone (cbdav->priv->store, zone);
+ e_timezone_cache_add_timezone (timezone_cache, zone);
icaltimezone_free (zone, TRUE);
} else {
GError **error)
{
ECalBackendHttpPrivate *priv = backend->priv;
+ ETimezoneCache *timezone_cache;
SoupMessage *soup_message;
SoupSession *soup_session;
icalcomponent *icalcomp, *subcomp;
SoupMessage *soup_message;
} cancel_data;
+ timezone_cache = E_TIMEZONE_CACHE (backend);
+
soup_session = backend->priv->soup_session;
soup_message = cal_backend_http_new_message (backend, uri);
zone = icaltimezone_new ();
icaltimezone_set_component (zone, icalcomponent_new_clone (subcomp));
- e_cal_backend_store_put_timezone (priv->store, zone);
+ e_timezone_cache_add_timezone (timezone_cache, zone);
icaltimezone_free (zone, 1);
}
GError **error)
{
ECalBackendHttp *cbhttp;
- ECalBackendHttpPrivate *priv;
+ ETimezoneCache *timezone_cache;
icalcomponent *tz_comp;
icaltimezone *zone;
cbhttp = (ECalBackendHttp *) backend;
+ timezone_cache = E_TIMEZONE_CACHE (backend);
e_return_data_cal_error_if_fail (E_IS_CAL_BACKEND_HTTP (cbhttp), InvalidArg);
e_return_data_cal_error_if_fail (tzobj != NULL, InvalidArg);
- priv = cbhttp->priv;
-
tz_comp = icalparser_parse_string (tzobj);
if (!tz_comp) {
g_propagate_error (error, EDC_ERROR (InvalidObject));
zone = icaltimezone_new ();
icaltimezone_set_component (zone, tz_comp);
- e_cal_backend_store_put_timezone (priv->store, zone);
+ e_timezone_cache_add_timezone (timezone_cache, zone);
}
/* Get_objects_in_range handler for the file backend */
return ret_val;
}
-static gboolean
-cal_backend_store_put_timezone (ECalBackendStore *store,
- icaltimezone *zone)
-{
- ETimezoneCache *timezone_cache;
-
- timezone_cache = e_cal_backend_store_ref_timezone_cache (store);
- e_timezone_cache_add_timezone (timezone_cache, zone);
- g_object_unref (timezone_cache);
-
- store->priv->dirty = TRUE;
-
- if (!store->priv->freeze_changes)
- cal_backend_store_save_cache (store);
-
- return TRUE;
-}
-
static const icaltimezone *
cal_backend_store_get_default_timezone (ECalBackendStore *store)
{
class->put_component = cal_backend_store_put_component;
class->remove_component = cal_backend_store_remove_component;
class->has_component = cal_backend_store_has_component;
- class->put_timezone = cal_backend_store_put_timezone;
class->get_default_timezone = cal_backend_store_get_default_timezone;
class->set_default_timezone = cal_backend_store_set_default_timezone;
class->get_components_by_uid = cal_backend_store_get_components_by_uid;
}
/**
- * e_cal_backend_store_put_timezone:
- *
- * Since: 2.28
- **/
-gboolean
-e_cal_backend_store_put_timezone (ECalBackendStore *store,
- icaltimezone *zone)
-{
- ECalBackendStoreClass *class;
-
- g_return_val_if_fail (E_IS_CAL_BACKEND_STORE (store), FALSE);
- g_return_val_if_fail (zone != NULL, FALSE);
-
- class = E_CAL_BACKEND_STORE_GET_CLASS (store);
- g_return_val_if_fail (class->put_timezone != NULL, FALSE);
-
- return class->put_timezone (store, zone);
-}
-
-/**
* e_cal_backend_store_get_default_timezone:
*
* Since: 2.28
GSList * (*get_components) (ECalBackendStore *store);
GSList * (*get_component_ids) (ECalBackendStore *store);
- gboolean (*put_timezone) (ECalBackendStore *store,
- icaltimezone *zone);
const icaltimezone *
(*get_default_timezone) (ECalBackendStore *store);
gboolean (*set_default_timezone) (ECalBackendStore *store,
(ECalBackendStore *store,
const gchar *uid,
const gchar *rid);
-gboolean e_cal_backend_store_put_timezone (ECalBackendStore *store,
- icaltimezone *zone);
const icaltimezone *
e_cal_backend_store_get_default_timezone
(ECalBackendStore *store);
e_cal_backend_store_put_component
e_cal_backend_store_remove_component
e_cal_backend_store_has_component
-e_cal_backend_store_put_timezone
e_cal_backend_store_get_default_timezone
e_cal_backend_store_set_default_timezone
e_cal_backend_store_get_components_by_uid