[evolution-ews] Adapt to CamelFolderSummary changes.



commit 52527c6aa7147743334cbf45be116bcdb8581bec
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Nov 13 00:40:50 2011 -0500

    Adapt to CamelFolderSummary changes.

 src/camel/camel-ews-folder.c  |    6 +--
 src/camel/camel-ews-summary.c |   70 +----------------------------------------
 src/camel/camel-ews-summary.h |    3 +-
 3 files changed, 4 insertions(+), 75 deletions(-)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index ee19160..56f2c09 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -851,7 +851,7 @@ camel_ews_folder_new (CamelStore *store, const gchar *folder_name, const gchar *
 {
 	CamelFolder *folder;
 	CamelEwsFolder *ews_folder;
-	gchar *summary_file, *state_file;
+	gchar *state_file;
 	const gchar *short_name;
 
 	short_name = strrchr (folder_name, '/');
@@ -867,9 +867,7 @@ camel_ews_folder_new (CamelStore *store, const gchar *folder_name, const gchar *
 
 	ews_folder = CAMEL_EWS_FOLDER(folder);
 
-	summary_file = g_build_filename (folder_dir, "summary", NULL);
-	folder->summary = camel_ews_summary_new (folder, summary_file);
-	g_free(summary_file);
+	folder->summary = camel_ews_summary_new (folder);
 
 	if (!folder->summary) {
 		g_object_unref (CAMEL_OBJECT (folder));
diff --git a/src/camel/camel-ews-summary.c b/src/camel/camel-ews-summary.c
index 9f3016e..88a351e 100644
--- a/src/camel/camel-ews-summary.c
+++ b/src/camel/camel-ews-summary.c
@@ -44,12 +44,6 @@
 #define d(x)
 
 /*Prototypes*/
-static gint ews_summary_header_load (CamelFolderSummary *, FILE *);
-static gint ews_summary_header_save (CamelFolderSummary *, FILE *);
-
-static CamelMessageInfo *ews_message_info_migrate (CamelFolderSummary *s, FILE *in);
-
-static CamelMessageContentInfo * ews_content_info_migrate (CamelFolderSummary *s, FILE *in);
 static gboolean ews_info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set);
 
 static gboolean summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
@@ -114,10 +108,6 @@ camel_ews_summary_class_init (CamelEwsSummaryClass *class)
 	folder_summary_class->content_info_size = sizeof (CamelEwsMessageContentInfo);
 	folder_summary_class->message_info_clone = ews_message_info_clone;
 	folder_summary_class->message_info_free = ews_message_info_free;
-	folder_summary_class->summary_header_load = ews_summary_header_load;
-	folder_summary_class->summary_header_save = ews_summary_header_save;
-	folder_summary_class->message_info_migrate = ews_message_info_migrate;
-	folder_summary_class->content_info_migrate = ews_content_info_migrate;
 	folder_summary_class->info_set_flags = ews_info_set_flags;
 	folder_summary_class->summary_header_to_db = summary_header_to_db;
 	folder_summary_class->summary_header_from_db = summary_header_from_db;
@@ -134,7 +124,6 @@ camel_ews_summary_init (CamelEwsSummary *ews_summary)
 
 /**
  * camel_ews_summary_new:
- * @filename: the file to store the summary in.
  *
  * This will create a new CamelEwsSummary object and read in the
  * summary data from disk, if it exists.
@@ -142,13 +131,12 @@ camel_ews_summary_init (CamelEwsSummary *ews_summary)
  * Returns: A new CamelEwsSummary object.
  **/
 CamelFolderSummary *
-camel_ews_summary_new (struct _CamelFolder *folder, const gchar *filename)
+camel_ews_summary_new (struct _CamelFolder *folder)
 {
 	CamelFolderSummary *summary;
 
 	summary = g_object_new (CAMEL_TYPE_EWS_SUMMARY, "folder", folder, NULL);
 	camel_folder_summary_set_build_content (summary, TRUE);
-	camel_folder_summary_set_filename (summary, filename);
 
 	camel_folder_summary_load_from_db (summary, NULL);
 
@@ -176,22 +164,6 @@ summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
 	return TRUE;
 }
 
-static gint
-ews_summary_header_load (CamelFolderSummary *s, FILE *in)
-{
-	CamelEwsSummary *gms = CAMEL_EWS_SUMMARY (s);
-
-	if (CAMEL_FOLDER_SUMMARY_CLASS (camel_ews_summary_parent_class)->summary_header_load (s, in) == -1)
-		return -1;
-
-	if (camel_file_util_decode_fixed_int32(in, &gms->version) == -1)
-		return -1;
-
-	if (camel_file_util_decode_string (in, &gms->sync_state) == -1)
-		return -1;
-	return 0;
-}
-
 static CamelFIRecord *
 summary_header_to_db (CamelFolderSummary *s, GError **error)
 {
@@ -208,18 +180,6 @@ summary_header_to_db (CamelFolderSummary *s, GError **error)
 
 }
 
-static gint
-ews_summary_header_save (CamelFolderSummary *s, FILE *out)
-{
-	CamelEwsSummary *gms = CAMEL_EWS_SUMMARY(s);
-
-	if (CAMEL_FOLDER_SUMMARY_CLASS (camel_ews_summary_parent_class)->summary_header_save (s, out) == -1)
-		return -1;
-
-	camel_file_util_encode_fixed_int32(out, CAMEL_EWS_SUMMARY_VERSION);
-	return camel_file_util_encode_string (out, gms->sync_state);
-}
-
 static CamelMessageInfo *
 message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 {
@@ -244,25 +204,6 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 	return info;
 }
 
-static CamelMessageInfo *
-ews_message_info_migrate (CamelFolderSummary *s, FILE *in)
-{
-	CamelMessageInfo *info;
-	CamelEwsMessageInfo *ews_info;
-
-	info = CAMEL_FOLDER_SUMMARY_CLASS (camel_ews_summary_parent_class)->message_info_migrate (s,in);
-	if (info) {
-		ews_info = (CamelEwsMessageInfo*) info;
-		if (camel_file_util_decode_uint32 (in, &ews_info->server_flags) == -1)
-			goto error;
-	}
-
-	return info;
-error:
-	camel_message_info_free (info);
-	return NULL;
-}
-
 static CamelMIRecord *
 message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
 {
@@ -296,15 +237,6 @@ content_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 		return camel_folder_summary_content_info_new (s);
 }
 
-static CamelMessageContentInfo *
-ews_content_info_migrate (CamelFolderSummary *s, FILE *in)
-{
-	if (fgetc (in))
-		return CAMEL_FOLDER_SUMMARY_CLASS (camel_ews_summary_parent_class)->content_info_migrate (s, in);
-	else
-		return camel_folder_summary_content_info_new (s);
-}
-
 static gboolean
 content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir)
 {
diff --git a/src/camel/camel-ews-summary.h b/src/camel/camel-ews-summary.h
index bfc2b18..7c21c71 100644
--- a/src/camel/camel-ews-summary.h
+++ b/src/camel/camel-ews-summary.h
@@ -82,8 +82,7 @@ struct _CamelEwsSummaryClass {
 GType camel_ews_summary_get_type (void);
 
 CamelFolderSummary *
-	camel_ews_summary_new		(struct _CamelFolder *folder,
-					 const gchar *filename);
+	camel_ews_summary_new		(struct _CamelFolder *folder);
 gboolean
 	camel_ews_update_message_info_flags
 					(CamelFolderSummary *summary,



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