[evolution-groupwise] Adapt to recent ECalBackend API changes



commit b059a9daecfeb8f10c0a6f8e8cee5d279f18cd92
Author: Milan Crha <mcrha redhat com>
Date:   Wed Oct 19 15:34:34 2011 +0200

    Adapt to recent ECalBackend API changes

 src/calendar/e-cal-backend-groupwise.c |   39 ++++++++++++++-----------------
 1 files changed, 18 insertions(+), 21 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-groupwise.c b/src/calendar/e-cal-backend-groupwise.c
index b77171d..ab40b61 100644
--- a/src/calendar/e-cal-backend-groupwise.c
+++ b/src/calendar/e-cal-backend-groupwise.c
@@ -1749,7 +1749,7 @@ e_cal_backend_groupwise_internal_get_timezone (ECalBackend *backend,
 static EGwConnectionStatus
 update_from_server (ECalBackendGroupwise *cbgw,
                     GSList *uid_list,
-                    gchar **calobj,
+                    icalcomponent **new_icalcomp,
                     ECalComponent *comp)
 {
 	EGwConnectionStatus stat;
@@ -1787,14 +1787,11 @@ update_from_server (ECalBackendGroupwise *cbgw,
 		put_component_to_store (cbgw, e_cal_comp);
 
 		if (i == 0) {
-			*calobj = e_cal_component_get_as_string (e_cal_comp);
+			*new_icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (e_cal_comp));
 		}
 
 		if (i != 0) {
-			gchar *temp;
-			temp = e_cal_component_get_as_string (e_cal_comp);
-			e_cal_backend_notify_object_created (E_CAL_BACKEND (cbgw), temp);
-			g_free (temp);
+			e_cal_backend_notify_component_created (E_CAL_BACKEND (cbgw), e_cal_component_get_icalcomponent (e_cal_comp));
 		}
 
 		g_object_unref (e_cal_comp);
@@ -1810,7 +1807,7 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend,
                                        GCancellable *cancellable,
                                        const gchar *in_calobj,
                                        gchar **uid,
-                                       gchar **new_calobj,
+                                       icalcomponent **new_icalcomp,
                                        GError **error)
 {
 	ECalBackendGroupwise *cbgw;
@@ -1825,7 +1822,7 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend,
 
 	e_return_data_cal_error_if_fail (E_IS_CAL_BACKEND_GROUPWISE (cbgw), InvalidArg);
 	e_return_data_cal_error_if_fail (in_calobj != NULL, InvalidArg);
-	e_return_data_cal_error_if_fail (new_calobj != NULL, InvalidArg);
+	e_return_data_cal_error_if_fail (new_icalcomp != NULL, InvalidArg);
 
 	if (!e_backend_get_online (E_BACKEND (backend))) {
 		in_offline (cbgw);
@@ -1879,7 +1876,7 @@ e_cal_backend_groupwise_create_object (ECalBackendSync *backend,
 		}
 
 		/* Get the item back from server to update the last-modified time */
-		status = update_from_server (cbgw, uid_list, new_calobj, comp);
+		status = update_from_server (cbgw, uid_list, new_icalcomp, comp);
 		if (status != E_GW_CONNECTION_STATUS_OK) {
 			g_propagate_error (error, EDC_ERROR_FAILED_STATUS (OtherError, status));
 			return;
@@ -1935,8 +1932,8 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend,
                                        GCancellable *cancellable,
                                        const gchar *calobj,
                                        CalObjModType mod,
-                                       gchar **old_object,
-                                       gchar **new_object,
+                                       icalcomponent **old_icalcomp,
+                                       icalcomponent **new_icalcomp,
                                        GError **error)
 {
 	ECalBackendGroupwise *cbgw;
@@ -1948,7 +1945,7 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend,
 	const gchar *uid = NULL;
 	gchar *rid = NULL;
 
-	*old_object = NULL;
+	*old_icalcomp = NULL;
 	cbgw = E_CAL_BACKEND_GROUPWISE (backend);
 	priv = cbgw->priv;
 
@@ -2008,7 +2005,7 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend,
 				}
 
 				put_component_to_store (cbgw, comp);
-				*new_object = e_cal_component_get_as_string (comp);
+				*new_icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (comp));
 				break;
 			}
 
@@ -2067,7 +2064,7 @@ e_cal_backend_groupwise_modify_object (ECalBackendSync *backend,
 		put_component_to_store (cbgw, comp);
 	}
 
-	*old_object = e_cal_component_get_as_string (cache_comp);
+	*old_icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (cache_comp));
 	g_object_unref (cache_comp);
 	g_object_unref (comp);
 	g_free (rid);
@@ -2102,8 +2099,8 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend,
                                        const gchar *uid,
                                        const gchar *rid,
                                        CalObjModType mod,
-                                       gchar **old_object,
-                                       gchar **object,
+                                       icalcomponent **old_icalcomp,
+                                       icalcomponent **new_icalcomp,
                                        GError **perror)
 {
 	ECalBackendGroupwise *cbgw;
@@ -2115,7 +2112,7 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend,
 	cbgw = E_CAL_BACKEND_GROUPWISE (backend);
 	priv = cbgw->priv;
 
-	*old_object = *object = NULL;
+	*old_icalcomp = *new_icalcomp = NULL;
 
 	/* if online, remove the item from the server */
 	if (e_backend_get_online (E_BACKEND (backend))) {
@@ -2156,8 +2153,8 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend,
 					g_propagate_error (perror, EDC_ERROR (ObjectNotFound));
 					return;
 				}
-				*object = NULL;
-				*old_object = strdup (calobj);
+				*new_icalcomp = NULL;
+				*old_icalcomp = icalparser_parse_string (calobj);
 				g_free (calobj);
 				return;
 			} else {
@@ -2212,8 +2209,8 @@ e_cal_backend_groupwise_remove_object (ECalBackendSync *backend,
 				/* Setting NULL would trigger another signal.
 				 * We do not set the *object to NULL  */
 				g_slist_free (comp_list);
-				*old_object = strdup (calobj);
-				*object = NULL;
+				*old_icalcomp = icalparser_parse_string (calobj);
+				*new_icalcomp = NULL;
 				g_free (calobj);
 				return;
 			} else {



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