2004-02-02 Rodrigo Moya <rodrigo@ximian.com>
+ * backends/groupwise/e-gw-item.c (e_gw_item_to_calcomponent): moved
+ calls to e_cal_component_set_new_vtype up, so that the internal
+ icalcomponent gets created. Added missing 'break' statement.
+
+2004-02-02 Rodrigo Moya <rodrigo@ximian.com>
+
* backends/groupwise/e-gw-connection.c
(e_gw_connection_get_freebusy_info): fixed warning.
comp = e_cal_component_new ();
+ if (item->priv->item_type == E_GW_ITEM_TYPE_APPOINTMENT)
+ e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
+ else if (item->priv->item_type == E_GW_ITEM_TYPE_TASK)
+ e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_TODO);
+ else {
+ g_object_unref (comp);
+ return NULL;
+ }
+
/* set common properties */
/* UID */
e_cal_component_set_uid (comp, e_gw_item_get_id (item));
/* set specific properties */
switch (item->priv->item_type) {
case E_GW_ITEM_TYPE_APPOINTMENT :
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
-
/* transparency */
description = e_gw_item_get_accept_level (item);
if (description &&
/* FIXME: attendee list, get_distribution */
break;
case E_GW_ITEM_TYPE_TASK :
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_TODO);
-
/* due date */
itt = e_gw_item_get_due_date (item);
dt.value = &itt;
e_cal_component_set_priority (comp, &priority);
/* FIXME: EGwItem's completed is a boolean */
- default :
- g_object_unref (comp);
- return NULL;
+ break;
}
return comp;
comp = e_cal_component_new ();
+ if (item->priv->item_type == E_GW_ITEM_TYPE_APPOINTMENT)
+ e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
+ else if (item->priv->item_type == E_GW_ITEM_TYPE_TASK)
+ e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_TODO);
+ else {
+ g_object_unref (comp);
+ return NULL;
+ }
+
/* set common properties */
/* UID */
e_cal_component_set_uid (comp, e_gw_item_get_id (item));
/* set specific properties */
switch (item->priv->item_type) {
case E_GW_ITEM_TYPE_APPOINTMENT :
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
-
/* transparency */
description = e_gw_item_get_accept_level (item);
if (description &&
/* FIXME: attendee list, get_distribution */
break;
case E_GW_ITEM_TYPE_TASK :
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_TODO);
-
/* due date */
itt = e_gw_item_get_due_date (item);
dt.value = &itt;
e_cal_component_set_priority (comp, &priority);
/* FIXME: EGwItem's completed is a boolean */
- default :
- g_object_unref (comp);
- return NULL;
+ break;
}
return comp;