-2004-01-26 JP Rosevear <jpr@ximian.com>
+2004-01-27 Rodrigo Moya <rodrigo@ximian.com>
+
+ * backends/groupwise/e-gw-connection.c
+ (get_attendee_list_from_soap_parameter): don't allocate memory for
+ ECalComponentAttendee's fields, make them just point to the values
+ contained in the SoupSoapResponse.
+ (get_e_cal_component_from_soap_parameter): don't free
+ ECalComponentAttendee's fields, free the structure.
+ (e_gw_connection_send_item): fixed warnings.
+
+ * backends/groupwise/e-cal-backend-groupwise.c
+ (e_cal_backend_groupwise_get_object):
+ (e_cal_backend_groupwise_remove): lock/unlock the mutex when accessing
+ private fields.
+
+2004-01-27 JP Rosevear <jpr@ximian.com>
* libedata-cal/e-cal-backend-cache.c (get_filename_from_uri): take
a const uri
* libedata-cal/e-cal-backend-sexp.c (func_uid): make sure we
always set a return value
-2004-01-26 JP Rosevear <jpr@ximian.com>
+2004-01-27 JP Rosevear <jpr@ximian.com>
* backends/groupwise/e-gw-connection.c
(get_e_cal_component_from_soap_parameter): description is not
cbgw = E_CAL_BACKEND_GROUPWISE (backend);
priv = cbgw->priv;
+ g_mutex_lock (priv->mutex);
+
/* remove the cache */
if (priv->cache)
e_file_cache_remove (E_FILE_CACHE (priv->cache));
+ g_mutex_unlock (priv->mutex);
+
return GNOME_Evolution_Calendar_Success;
}
*object = e_cal_component_get_as_string (comp);
g_object_unref (comp);
-
+
return GNOME_Evolution_Calendar_Success;
}
priv = cbgw->priv;
+ g_mutex_lock (priv->mutex);
+
/* search the object in the cache */
comp = e_cal_backend_cache_get_component (priv->cache, uid, rid);
if (comp) {
+ g_mutex_unlock (priv->mutex);
*object = e_cal_component_get_as_string (comp);
g_object_unref (comp);
return GNOME_Evolution_Calendar_Success;
}
+ g_mutex_unlock (priv->mutex);
+
/* callers will never have a uuid that is in server but not in cache */
return GNOME_Evolution_Calendar_ObjectNotFound;
}
g_list_free (components);
g_mutex_unlock (priv->mutex);
-
+
return GNOME_Evolution_Calendar_Success;
}
EGwConnectionStatus status;
ECalBackendGroupwise *cbgw;
EGwConnection *cnc;
-
+
cbgw = E_CAL_BACKEND_GROUPWISE (backend);
cnc = cbgw->priv->cnc;
{
ECalBackendGroupwiseComputeChangesData *be_data = data;
- if (!e_cal_backend_cache_get_component (be_data->backend->priv->cache, key, NULL)) {
+ if (!e_cal_backend_cache_get_component (be_data->backend->priv->cache, key, NULL)) {
ECalComponent *comp;
comp = e_cal_component_new ();
SoupSoapParameter *subparam;
attendee = g_new0 (ECalComponentAttendee, 1);
-
+
subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "email");
if (subparam) {
email = soup_soap_parameter_get_string_value (subparam);
if (email)
- attendee->value = g_strdup (email);
+ attendee->value = email;
}
subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "displayName");
if (subparam) {
cn = soup_soap_parameter_get_string_value (subparam);
if (cn)
- attendee->cn = g_strdup (cn);
+ attendee->cn = cn;
}
subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "distType");
attendee->role = ICAL_ROLE_OPTPARTICIPANT;
else
attendee->role = ICAL_ROLE_NONPARTICIPANT;
- }
+ }
+
list = g_slist_append (list, attendee);
}
/* Property - attendee-list*/
subparam = soup_soap_parameter_get_first_child_by_name (param, "distribution");
/* FIXME what to do with 'from' data*/
-
subparam = soup_soap_parameter_get_first_child_by_name (subparam, "recipients");
if (subparam)
attendee_list = get_attendee_list_from_soap_parameter (subparam);
if (attendee_list) {
- GSList *l;
e_cal_component_set_attendee_list (comp, attendee_list);
- for (l = attendee_list; l != NULL; l = g_slist_next (l)) {
- ECalComponentAttendee *attendee;
- attendee = (ECalComponentAttendee*) l->data;
- g_free (attendee->cn);
- g_free (attendee->value);
- }
g_slist_foreach (attendee_list, (GFunc) g_free, NULL);
}
EGwConnectionStatus
e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item)
{
- SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status = E_GW_CONNECTION_STATUS_UNKNOWN;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
g_return_val_if_fail (E_IS_GW_ITEM (item), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
SoupSoapParameter *subparam;
attendee = g_new0 (ECalComponentAttendee, 1);
-
+
subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "email");
if (subparam) {
email = soup_soap_parameter_get_string_value (subparam);
if (email)
- attendee->value = g_strdup (email);
+ attendee->value = email;
}
subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "displayName");
if (subparam) {
cn = soup_soap_parameter_get_string_value (subparam);
if (cn)
- attendee->cn = g_strdup (cn);
+ attendee->cn = cn;
}
subparam = soup_soap_parameter_get_first_child_by_name (param_recipient, "distType");
attendee->role = ICAL_ROLE_OPTPARTICIPANT;
else
attendee->role = ICAL_ROLE_NONPARTICIPANT;
- }
+ }
+
list = g_slist_append (list, attendee);
}
/* Property - attendee-list*/
subparam = soup_soap_parameter_get_first_child_by_name (param, "distribution");
/* FIXME what to do with 'from' data*/
-
subparam = soup_soap_parameter_get_first_child_by_name (subparam, "recipients");
if (subparam)
attendee_list = get_attendee_list_from_soap_parameter (subparam);
if (attendee_list) {
- GSList *l;
e_cal_component_set_attendee_list (comp, attendee_list);
- for (l = attendee_list; l != NULL; l = g_slist_next (l)) {
- ECalComponentAttendee *attendee;
- attendee = (ECalComponentAttendee*) l->data;
- g_free (attendee->cn);
- g_free (attendee->value);
- }
g_slist_foreach (attendee_list, (GFunc) g_free, NULL);
}
EGwConnectionStatus
e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item)
{
- SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status = E_GW_CONNECTION_STATUS_UNKNOWN;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
g_return_val_if_fail (E_IS_GW_ITEM (item), E_GW_CONNECTION_STATUS_INVALID_OBJECT);