moved calls to e_cal_component_set_new_vtype up, so that the internal
authorRodrigo Moya <rodrigo@ximian.com>
Mon, 2 Feb 2004 15:15:34 +0000 (15:15 +0000)
committerRodrigo Moya <rodrigo@src.gnome.org>
Mon, 2 Feb 2004 15:15:34 +0000 (15:15 +0000)
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.

calendar/ChangeLog
calendar/backends/groupwise/e-gw-item.c
servers/groupwise/e-gw-item.c

index 6f144b9..5c2cbe6 100644 (file)
@@ -1,5 +1,11 @@
 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.
 
index 2f331ed..4f7201c 100644 (file)
@@ -709,6 +709,15 @@ e_gw_item_to_cal_component (EGwItem *item)
 
        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));
@@ -750,8 +759,6 @@ e_gw_item_to_cal_component (EGwItem *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 &&
@@ -767,8 +774,6 @@ e_gw_item_to_cal_component (EGwItem *item)
                /* 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;
@@ -790,9 +795,7 @@ e_gw_item_to_cal_component (EGwItem *item)
                e_cal_component_set_priority (comp, &priority);
 
                /* FIXME: EGwItem's completed is a boolean */
-       default :
-               g_object_unref (comp);
-               return NULL;
+               break;
        }
 
        return comp;
index 2f331ed..4f7201c 100644 (file)
@@ -709,6 +709,15 @@ e_gw_item_to_cal_component (EGwItem *item)
 
        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));
@@ -750,8 +759,6 @@ e_gw_item_to_cal_component (EGwItem *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 &&
@@ -767,8 +774,6 @@ e_gw_item_to_cal_component (EGwItem *item)
                /* 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;
@@ -790,9 +795,7 @@ e_gw_item_to_cal_component (EGwItem *item)
                e_cal_component_set_priority (comp, &priority);
 
                /* FIXME: EGwItem's completed is a boolean */
-       default :
-               g_object_unref (comp);
-               return NULL;
+               break;
        }
 
        return comp;