[evolution-ews/gnome-2-28] Changes accordingly compat layer for previous patch



commit 08455d6b106bc5df10907b284527c0b5104bf816
Author: Punit Jain <jpunit novell com>
Date:   Mon Mar 12 14:39:59 2012 +0530

    Changes accordingly compat layer for previous patch

 src/camel/camel-ews-folder.c |   24 ++++++++++++------------
 src/utils/ews-camel-compat.c |   20 ++++++++++++++++++++
 src/utils/ews-camel-compat.h |    4 ++++
 3 files changed, 36 insertions(+), 12 deletions(-)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index 2ffa419..2a7cb43 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -105,9 +105,9 @@ ews_get_filename (CamelFolder *folder, const gchar *uid, GError **error)
 	gchar *ret;
 
 	g_checksum_update(sha, (guchar *)uid, strlen(uid));
-	ret = camel_data_cache_get_filename (ews_folder->cache, "cur",
-					     g_checksum_get_string (sha),
-					     error);
+	ret = camel_data_cache_get_filename_compat (ews_folder->cache, "cur",
+						    g_checksum_get_string (sha),
+						    error);
 	g_checksum_free (sha);
 	return ret;
 }
@@ -122,8 +122,8 @@ ews_data_cache_remove (CamelDataCache *cdc,
 	gint ret;
 
 	g_checksum_update(sha, (guchar *)key, strlen(key));
-	ret = camel_data_cache_remove (cdc, path, g_checksum_get_string (sha),
-				       error);
+	ret = camel_data_cache_remove_compat (cdc, path, g_checksum_get_string (sha),
+					      error);
 	g_checksum_free (sha);
 	return ret;
 }
@@ -138,8 +138,8 @@ ews_data_cache_get (CamelDataCache *cdc,
 	CamelStream *ret;
 
 	g_checksum_update(sha, (guchar *)key, strlen(key));
-	ret = camel_data_cache_get (cdc, path, g_checksum_get_string (sha),
-				    error);
+	ret = camel_data_cache_get_compat (cdc, path, g_checksum_get_string (sha),
+					   error);
 	g_checksum_free (sha);
 	return ret;
 }
@@ -154,9 +154,9 @@ ews_data_cache_get_filename (CamelDataCache *cdc,
 	gchar *ret;
 
 	g_checksum_update(sha, (guchar *)key, strlen(key));
-	ret = camel_data_cache_get_filename (cdc, path,
-					     g_checksum_get_string (sha),
-					     error);
+	ret = camel_data_cache_get_filename_compat (cdc, path,
+						    g_checksum_get_string (sha),
+						    error);
 	g_checksum_free (sha);
 	return ret;
 }
@@ -173,8 +173,8 @@ camel_ews_folder_get_message_from_cache (CamelEwsFolder *ews_folder, const gchar
 	g_static_rec_mutex_lock (&priv->cache_lock);
 	stream = ews_data_cache_get (ews_folder->cache, "cur", uid, error);
 	if (!stream) {
-		gchar *old_fname = camel_data_cache_get_filename (ews_folder->cache, "cur",
-								  uid, error);
+		gchar *old_fname = camel_data_cache_get_filename_compat (ews_folder->cache, "cur",
+									 uid, error);
 		if (!g_access (old_fname, R_OK)) {
 			gchar *new_fname = ews_data_cache_get_filename (ews_folder->cache,
 									"cur", uid, error);
diff --git a/src/utils/ews-camel-compat.c b/src/utils/ews-camel-compat.c
index 1d120ce..0536bba 100644
--- a/src/utils/ews-camel-compat.c
+++ b/src/utils/ews-camel-compat.c
@@ -65,6 +65,26 @@ camel_data_cache_get_filename_compat	(CamelDataCache *cdc,
 #endif
 }
 
+gint
+camel_data_cache_remove_compat (CamelDataCache *cdc,
+				const gchar *path,
+				const gchar *key,
+				GError **error)
+{
+#if EDS_CHECK_VERSION(2,29,0)
+	return camel_data_cache_remove (cdc, path, key, error);
+#else
+	CamelException ex;
+	gint ret;
+	
+	camel_exception_init (&ex);
+	ret = camel_data_cache_remove (cdc, path, key, &ex);
+	ews_compat_propagate_exception_to_gerror (&ex, error);
+
+	return ret;
+#endif
+}
+
 CamelDataCache *
 camel_data_cache_new_compat	(const gchar *path,
 		                 GError **error)
diff --git a/src/utils/ews-camel-compat.h b/src/utils/ews-camel-compat.h
index ee08495..55b523a 100644
--- a/src/utils/ews-camel-compat.h
+++ b/src/utils/ews-camel-compat.h
@@ -38,6 +38,10 @@ gchar *		camel_data_cache_get_filename_compat
 	                                         const gchar *path,
         	                                 const gchar *key,
                 	                         GError **error);
+gint		camel_data_cache_remove_compat (CamelDataCache *cdc,
+						const gchar *path,
+						const gchar *key,
+						GError **error);
 CamelDataCache *camel_data_cache_new_compat     (const gchar *path,
                 		                 GError **error);
 CamelStream *	camel_data_cache_get_compat     (CamelDataCache *cdc,



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