[evolution-groupwise] Adapt to CamelFolderSummary changes.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-groupwise] Adapt to CamelFolderSummary changes.
- Date: Sun, 13 Nov 2011 06:11:20 +0000 (UTC)
commit fba44490ac33868df3a5f2777e2a42bef82ac536
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Nov 13 00:46:11 2011 -0500
Adapt to CamelFolderSummary changes.
src/camel/camel-groupwise-folder.c | 12 +----
src/camel/camel-groupwise-summary.c | 77 +----------------------------------
src/camel/camel-groupwise-summary.h | 3 +-
3 files changed, 5 insertions(+), 87 deletions(-)
---
diff --git a/src/camel/camel-groupwise-folder.c b/src/camel/camel-groupwise-folder.c
index 356ac88..a92f992 100644
--- a/src/camel/camel-groupwise-folder.c
+++ b/src/camel/camel-groupwise-folder.c
@@ -368,7 +368,7 @@ groupwise_folder_rename (CamelFolder *folder,
CamelStore *parent_store;
CamelService *service;
const gchar *user_data_dir;
- gchar *folder_dir, *summary_path, *state_file;
+ gchar *folder_dir, *state_file;
gchar *folders;
parent_store = camel_folder_get_parent_store (folder);
@@ -382,20 +382,16 @@ groupwise_folder_rename (CamelFolder *folder,
folder_dir = e_path_to_physical (folders, new);
g_free (folders);
- summary_path = g_strdup_printf ("%s/summary", folder_dir);
-
CAMEL_GROUPWISE_FOLDER_REC_LOCK (folder, cache_lock);
camel_data_cache_set_path (gw_folder->cache, folder_dir);
CAMEL_GROUPWISE_FOLDER_REC_UNLOCK (folder, cache_lock);
((CamelFolderClass *) camel_groupwise_folder_parent_class)->rename (folder, new);
- camel_folder_summary_set_filename (folder->summary, summary_path);
state_file = g_strdup_printf ("%s/cmeta", folder_dir);
camel_object_set_state_filename (CAMEL_OBJECT (folder), state_file);
g_free (state_file);
- g_free (summary_path);
g_free (folder_dir);
}
@@ -952,7 +948,7 @@ camel_gw_folder_new (CamelStore *store,
CamelFolder *folder;
CamelGroupwiseFolder *gw_folder;
gboolean filter_inbox;
- gchar *summary_file, *state_file, *journal_file;
+ gchar *state_file, *journal_file;
gchar *short_name;
service = CAMEL_SERVICE (store);
@@ -974,9 +970,7 @@ camel_gw_folder_new (CamelStore *store,
gw_folder = CAMEL_GROUPWISE_FOLDER (folder);
- summary_file = g_strdup_printf ("%s/summary",folder_dir);
- folder->summary = camel_groupwise_summary_new (folder, summary_file);
- g_free (summary_file);
+ folder->summary = camel_groupwise_summary_new (folder);
if (!folder->summary) {
g_object_unref (CAMEL_OBJECT (folder));
g_set_error (
diff --git a/src/camel/camel-groupwise-summary.c b/src/camel/camel-groupwise-summary.c
index e63f53c..c412897 100644
--- a/src/camel/camel-groupwise-summary.c
+++ b/src/camel/camel-groupwise-summary.c
@@ -41,12 +41,6 @@
#define d(x)
/*Prototypes*/
-static gint gw_summary_header_load (CamelFolderSummary *, FILE *);
-static gint gw_summary_header_save (CamelFolderSummary *, FILE *);
-
-static CamelMessageInfo *gw_message_info_migrate (CamelFolderSummary *s, FILE *in);
-
-static CamelMessageContentInfo * gw_content_info_migrate (CamelFolderSummary *s, FILE *in);
static gboolean gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set);
static gboolean summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir);
@@ -85,10 +79,6 @@ camel_groupwise_summary_class_init (CamelGroupwiseSummaryClass *class)
folder_summary_class->message_info_size = sizeof (CamelGroupwiseMessageInfo);
folder_summary_class->content_info_size = sizeof (CamelGroupwiseMessageContentInfo);
folder_summary_class->message_info_clone = gw_message_info_clone;
- folder_summary_class->summary_header_load = gw_summary_header_load;
- folder_summary_class->summary_header_save = gw_summary_header_save;
- folder_summary_class->message_info_migrate = gw_message_info_migrate;
- folder_summary_class->content_info_migrate = gw_content_info_migrate;
folder_summary_class->info_set_flags = gw_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;
@@ -105,7 +95,6 @@ camel_groupwise_summary_init (CamelGroupwiseSummary *gw_summary)
/**
* camel_groupwise_summary_new:
- * @filename: the file to store the summary in.
*
* This will create a new CamelGroupwiseSummary object and read in the
* summary data from disk, if it exists.
@@ -113,14 +102,12 @@ camel_groupwise_summary_init (CamelGroupwiseSummary *gw_summary)
* Returns: A new CamelGroupwiseSummary object.
**/
CamelFolderSummary *
-camel_groupwise_summary_new (struct _CamelFolder *folder,
- const gchar *filename)
+camel_groupwise_summary_new (struct _CamelFolder *folder)
{
CamelFolderSummary *summary;
summary = g_object_new (CAMEL_TYPE_GROUPWISE_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);
@@ -149,24 +136,6 @@ summary_header_from_db (CamelFolderSummary *s,
return TRUE;
}
-static gint
-gw_summary_header_load (CamelFolderSummary *s,
- FILE *in)
-{
- CamelGroupwiseSummary *gms = CAMEL_GROUPWISE_SUMMARY (s);
-
- if (CAMEL_FOLDER_SUMMARY_CLASS (camel_groupwise_summary_parent_class)->summary_header_load (s, in) == -1)
- return -1;
-
- if (camel_file_util_decode_fixed_int32 (in, &gms->version) == -1
- || camel_file_util_decode_fixed_int32 (in, &gms->validity) == -1)
- return -1;
-
- if (camel_file_util_decode_string (in, &gms->time_string) == -1)
- return -1;
- return 0;
-}
-
static CamelFIRecord *
summary_header_to_db (CamelFolderSummary *s,
GError **error)
@@ -184,20 +153,6 @@ summary_header_to_db (CamelFolderSummary *s,
}
-static gint
-gw_summary_header_save (CamelFolderSummary *s,
- FILE *out)
-{
- CamelGroupwiseSummary *gms = CAMEL_GROUPWISE_SUMMARY (s);
-
- if (CAMEL_FOLDER_SUMMARY_CLASS (camel_groupwise_summary_parent_class)->summary_header_save (s, out) == -1)
- return -1;
-
- camel_file_util_encode_fixed_int32 (out, CAMEL_GW_SUMMARY_VERSION);
- camel_file_util_encode_fixed_int32 (out, gms->validity);
- return camel_file_util_encode_string (out, gms->time_string);
-}
-
static CamelMessageInfo *
message_info_from_db (CamelFolderSummary *s,
CamelMIRecord *mir)
@@ -214,26 +169,6 @@ message_info_from_db (CamelFolderSummary *s,
return info;}
-static CamelMessageInfo *
-gw_message_info_migrate (CamelFolderSummary *s,
- FILE *in)
-{
- CamelMessageInfo *info;
- CamelGroupwiseMessageInfo *gw_info;
-
- info = CAMEL_FOLDER_SUMMARY_CLASS (camel_groupwise_summary_parent_class)->message_info_migrate (s,in);
- if (info) {
- gw_info = (CamelGroupwiseMessageInfo *) info;
- if (camel_file_util_decode_uint32 (in, &gw_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)
@@ -269,16 +204,6 @@ content_info_from_db (CamelFolderSummary *s,
return camel_folder_summary_content_info_new (s);
}
-static CamelMessageContentInfo *
-gw_content_info_migrate (CamelFolderSummary *s,
- FILE *in)
-{
- if (fgetc (in))
- return CAMEL_FOLDER_SUMMARY_CLASS (camel_groupwise_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,
diff --git a/src/camel/camel-groupwise-summary.h b/src/camel/camel-groupwise-summary.h
index 4ea56b7..1499e0f 100644
--- a/src/camel/camel-groupwise-summary.h
+++ b/src/camel/camel-groupwise-summary.h
@@ -80,8 +80,7 @@ struct _CamelGroupwiseSummaryClass {
GType camel_groupwise_summary_get_type (void);
CamelFolderSummary *
- camel_groupwise_summary_new (CamelFolder *folder,
- const gchar *filename);
+ camel_groupwise_summary_new (CamelFolder *folder);
void camel_gw_summary_add_offline (CamelFolderSummary *summary,
const gchar *uid,
CamelMimeMessage *messgae,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]