[evolution-ews] Add compatibility for camel changes in EDS 3.2



commit 17aacb963adbf0e7d4790c66a9d4a3a9308a76e2
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Thu Sep 8 12:21:02 2011 +0530

    Add compatibility for camel changes in EDS 3.2

 src/utils/Makefile.am        |    2 +
 src/utils/ews-camel-compat.c |   57 ++++++++++++++++++++++++++++++++++++++++++
 src/utils/ews-camel-compat.h |   43 +++++++++++++++++++++++++++++++
 3 files changed, 102 insertions(+), 0 deletions(-)
---
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index dcfb02c..7454a7f 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -13,6 +13,8 @@ libewsutils_la_CPPFLAGS = \
 	$(CAMEL_CFLAGS)
 
 libewsutils_la_SOURCES =				\
+	ews-camel-compat.h				\
+	ews-camel-compat.c				\
 	ews-esource-utils.h				\
 	ews-esource-utils.c				\
 	e-sqlite3-vfs.c					\
diff --git a/src/utils/ews-camel-compat.c b/src/utils/ews-camel-compat.c
new file mode 100644
index 0000000..0a4744a
--- /dev/null
+++ b/src/utils/ews-camel-compat.c
@@ -0,0 +1,57 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *
+ * Copyright (C) 1999-2011 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ */
+
+#include "ews-camel-compat.h"
+
+gchar *
+camel_session_get_password_compat (CamelSession *session,
+	                            CamelService *service,
+        	                    const gchar *domain,
+				    const gchar *prompt,
+                        	    const gchar *item,
+	                            guint32 flags,
+        	                    GError **error)
+{
+	
+#if ! EDS_CHECK_VERSION(3,1,0)
+	return camel_session_get_password (session, service, domain, prompt, item, flags, error);
+#else
+	return camel_session_get_password (session, service, prompt, item, flags, error);
+#endif	
+}
+
+
+#if ! EDS_CHECK_VERSION(3,1,0)
+
+CamelURL *
+camel_service_get_camel_url (CamelService *service)
+{
+	g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
+
+	return service->url;
+}
+
+CamelServiceConnectionStatus
+camel_service_get_connection_status (CamelService *service)
+{
+	return service->status;
+}
+
+#endif
diff --git a/src/utils/ews-camel-compat.h b/src/utils/ews-camel-compat.h
new file mode 100644
index 0000000..f9f9d95
--- /dev/null
+++ b/src/utils/ews-camel-compat.h
@@ -0,0 +1,43 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *
+ * Copyright (C) 1999-2011 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ */
+#ifndef EWS_CAMEL_COMPAT_H
+#define EWS_CAMEL_COMPAT_H
+
+#include <camel/camel.h>
+#include <libedataserver/eds-version.h>
+#include <glib.h>
+#include <gio/gio.h>
+
+gchar *
+camel_session_get_password_compat (CamelSession *session,
+	                            CamelService *service,
+				    const gchar *domain,
+                	            const gchar *prompt,
+                        	    const gchar *item,
+	                            guint32 flags,
+        	                    GError **error);
+
+#if ! EDS_CHECK_VERSION(3,1,0)
+CamelURL * camel_service_get_camel_url (CamelService *service);
+CamelServiceConnectionStatus camel_service_get_connection_status (CamelService *service);
+
+#endif
+
+#endif /* EWS_CAMEL_COMPAT_H */



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