[evolution-groupwise] Do not use deprecated EBook/ECal API



commit 59fc315fefd1d361c07df79c39a5fcf5397f76dc
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jun 14 08:58:19 2011 +0200

    Do not use deprecated EBook/ECal API

 configure.ac                    |    6 ++----
 src/plugins/camel-gw-listener.c |   12 ++++++------
 src/plugins/gw-ui.c             |   10 +++++-----
 src/plugins/process-meeting.c   |   31 +++++++++++++------------------
 4 files changed, 26 insertions(+), 33 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e58863f..9180f2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,6 +66,8 @@ AS_COMPILER_FLAGS(WARNING_FLAGS,
 	-DG_DISABLE_SINGLE_INCLUDES
 	-DGTK_DISABLE_SINGLE_INCLUDES
 	-DGSEAL_ENABLE
+	-DE_BOOK_DISABLE_DEPRECATED
+	-DE_CAL_DISABLE_DEPRECATED
 	-Wall -Wextra
 	-Wno-missing-field-initializers
 	-Wno-sign-compare
@@ -78,10 +80,6 @@ AS_COMPILER_FLAGS(WARNING_FLAGS,
 	-Wredundant-decls -Wundef -Wwrite-strings")
 AC_SUBST(WARNING_FLAGS)
 
-dnl Disable these later
-dnl	-DE_BOOK_DISABLE_DEPRECATED
-dnl	-DE_CAL_DISABLE_DEPRECATED
-dnl
 dnl Other useful compiler warnings for test builds only.
 dnl These may produce warnings we have no control over,
 dnl or false positives we don't always want to see.
diff --git a/src/plugins/camel-gw-listener.c b/src/plugins/camel-gw-listener.c
index 34aaae0..803adfa 100644
--- a/src/plugins/camel-gw-listener.c
+++ b/src/plugins/camel-gw-listener.c
@@ -31,7 +31,7 @@
 #include <e-gw-connection.h>
 #include <libedataserverui/e-passwords.h>
 #include "e-util/e-alert-dialog.h"
-#include <libecal/e-cal.h>
+#include <libecal/e-cal-client.h>
 #include <shell/e-shell.h>
 #include <e-util/e-account-utils.h>
 
@@ -942,16 +942,16 @@ prune_proxies (void) {
 	GError *err = NULL;
 	const gchar *parent_id_name = NULL;
 	gint i;
-	ECalSourceType types[] = { E_CAL_SOURCE_TYPE_EVENT,
-				    E_CAL_SOURCE_TYPE_TODO,
-				    E_CAL_SOURCE_TYPE_JOURNAL
-				  };
+	ECalClientSourceType types[] = { E_CAL_CLIENT_SOURCE_TYPE_EVENTS,
+					 E_CAL_CLIENT_SOURCE_TYPE_TASKS,
+					 E_CAL_CLIENT_SOURCE_TYPE_MEMOS
+					};
 
 	account_list = e_get_account_list ();
 	e_account_list_prune_proxies (account_list);
 
 	for (i=0; i<3; i++) {
-	if (e_cal_get_sources (&sources, types[i], &err)) {
+	if (e_cal_client_get_sources (&sources, types[i], &err)) {
 		/* peek groupwise id and prune for proxies. */
 		groups = e_source_list_peek_groups (sources);
 		for (l = groups; l != NULL;) {
diff --git a/src/plugins/gw-ui.c b/src/plugins/gw-ui.c
index d710329..dacfc88 100644
--- a/src/plugins/gw-ui.c
+++ b/src/plugins/gw-ui.c
@@ -303,7 +303,7 @@ needs_to_accept (icalcomponent *icalcomp, const gchar *user_email)
 }
 
 static gboolean
-is_meeting_owner (ECalComponent *comp, ECal *client)
+is_meeting_owner (ECalComponent *comp, ECalClient *client)
 {
 	ECalComponentOrganizer org;
 	gchar *email = NULL;
@@ -311,13 +311,13 @@ is_meeting_owner (ECalComponent *comp, ECal *client)
 	gboolean ret_val = FALSE;
 
 	if (!(e_cal_component_has_attendees (comp) &&
-				e_cal_get_save_schedules (client)))
+				e_cal_client_check_save_schedules (client)))
 		return ret_val;
 
 	e_cal_component_get_organizer (comp, &org);
 	strip = itip_strip_mailto (org.value);
 
-	if (e_cal_get_cal_address (client, &email, NULL) && !g_ascii_strcasecmp (email, strip)) {
+	if (e_client_get_backend_property_sync (E_CLIENT (client), CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS, &email, NULL, NULL) && !g_ascii_strcasecmp (email, strip)) {
 		ret_val = TRUE;
 	}
 
@@ -387,7 +387,7 @@ update_cal_entries_cb (EShellView *shell_view, gpointer user_data)
 			ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
 			const gchar *uri;
 
-			uri = is_comp_data_valid (event) ? e_cal_get_uri (event->comp_data->client) : NULL;
+			uri = is_comp_data_valid (event) ? e_client_get_uri (E_CLIENT (event->comp_data->client)) : NULL;
 
 			if (uri && g_ascii_strncasecmp (uri, "groupwise://", 12) == 0) {
 				visible = e_cal_util_component_has_attendee (event->comp_data->icalcomp);
@@ -397,7 +397,7 @@ update_cal_entries_cb (EShellView *shell_view, gpointer user_data)
 					comp = e_cal_component_new ();
 					e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
 
-					if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)) {
+					if (e_client_check_capability (E_CLIENT (event->comp_data->client), CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)) {
 						gchar *user_email;
 
 						user_email = itip_get_comp_attendee (comp, event->comp_data->client);
diff --git a/src/plugins/process-meeting.c b/src/plugins/process-meeting.c
index 2ada649..b8e5aa1 100644
--- a/src/plugins/process-meeting.c
+++ b/src/plugins/process-meeting.c
@@ -28,7 +28,7 @@
 #include <string.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <libecal/e-cal.h>
+#include <libecal/e-cal-client.h>
 
 #include <e-util/e-alert-dialog.h>
 #include <shell/e-shell-view.h>
@@ -40,19 +40,19 @@
 #include "gw-ui.h"
 
 typedef struct {
-	ECal *ecal;
+	ECalClient *client;
 	icalcomponent *icalcomp;
 } ReceiveData;
 
 static void
 finalize_receive_data (ReceiveData *r_data)
 {
-	if (r_data->ecal) {
-		g_object_unref (r_data->ecal);
-		r_data->ecal = NULL;
+	if (r_data->client) {
+		g_object_unref (r_data->client);
+		r_data->client = NULL;
 	}
 
-	if (r_data->ecal) {
+	if (r_data->icalcomp) {
 		icalcomponent_free (r_data->icalcomp);
 		r_data->icalcomp = NULL;
 	}
@@ -68,7 +68,7 @@ receive_objects (gpointer data)
 
 	icalcomponent_set_method (r_data->icalcomp, ICAL_METHOD_REQUEST);
 
-	if (!e_cal_receive_objects (r_data->ecal, r_data->icalcomp, &error)) {
+	if (!e_cal_client_receive_objects_sync (r_data->client, r_data->icalcomp, NULL, &error)) {
 		/* FIXME show an error dialog */
 		g_error_free (error);
 	}
@@ -170,7 +170,7 @@ process_meeting (ECalendarView *cal_view, icalparameter_partstat status)
 		clone = icalcomponent_new_clone (event->comp_data->icalcomp);
 		change_status (clone, address, status);
 
-		r_data->ecal = g_object_ref (event->comp_data->client);
+		r_data->client = g_object_ref (event->comp_data->client);
 		r_data->icalcomp = clone;
 
 		if (recurring) {
@@ -256,7 +256,7 @@ gw_meeting_decline_cb (GtkAction *action, EShellView *shell_view)
 }
 
 typedef struct {
-	ECal *client;
+	ECalClient *client;
 	ECalComponent *comp;
 	CalObjModType mod;
 } ThreadData;
@@ -303,7 +303,7 @@ retract_object (gpointer val)
 {
 	ThreadData *data = val;
 	icalcomponent *icalcomp = NULL, *mod_comp = NULL;
-	GList *users = NULL;
+	GSList *users = NULL;
 	gchar *rid = NULL;
 	const gchar *uid;
 	GError *error = NULL;
@@ -313,8 +313,7 @@ retract_object (gpointer val)
 	icalcomp = e_cal_component_get_icalcomponent (data->comp);
 	icalcomponent_set_method (icalcomp, ICAL_METHOD_CANCEL);
 
-	if (!e_cal_send_objects (data->client, icalcomp, &users,
-						&mod_comp, &error))	{
+	if (!e_cal_client_send_objects_sync (data->client, icalcomp, &users, &mod_comp, NULL, &error))	{
 		/* FIXME report error  */
 		g_warning ("Unable to retract the meeting \n");
 		g_clear_error (&error);
@@ -324,16 +323,12 @@ retract_object (gpointer val)
 	if (mod_comp)
 		icalcomponent_free (mod_comp);
 
-	if (users) {
-		g_list_foreach (users, (GFunc) g_free, NULL);
-		g_list_free (users);
-	}
+	e_client_util_free_string_slist (users);
 
 	rid = e_cal_component_get_recurid_as_string (data->comp);
 	e_cal_component_get_uid (data->comp, &uid);
 
-	if (!e_cal_remove_object_with_mod (data->client, uid,
-				rid, data->mod, &error)) {
+	if (!e_cal_client_remove_object_sync (data->client, uid, rid, data->mod, NULL, &error)) {
 		g_warning ("Unable to remove the item \n");
 		g_clear_error (&error);
 		return GINT_TO_POINTER (1);



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