diff options
author | Not Zed <NotZed@Ximian.com> | 2004-11-12 13:53:12 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-11-12 13:53:12 +0800 |
commit | 8e212824134c1740d05fb36799f78716c5059801 (patch) | |
tree | 47fc692dba176af4fa0ccfa45d31739886162c12 /camel/providers/nntp | |
parent | 55bead18b69fd4e7ad2b09700867add2ca7e9838 (diff) | |
download | gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.gz gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.bz2 gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.lz gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.xz gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.zst gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.zip |
** Merge in notzed-messageinfo-branch, fix some minor conflicts.
2004-11-12 Not Zed <NotZed@Ximian.com>
** Merge in notzed-messageinfo-branch, fix some minor conflicts.
svn path=/trunk/; revision=27898
Diffstat (limited to 'camel/providers/nntp')
-rw-r--r-- | camel/providers/nntp/camel-nntp-folder.c | 2 | ||||
-rw-r--r-- | camel/providers/nntp/camel-nntp-summary.c | 36 | ||||
-rw-r--r-- | camel/providers/nntp/camel-nntp-summary.h | 2 |
3 files changed, 21 insertions, 19 deletions
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c index 7f06555b43..de0f4cd222 100644 --- a/camel/providers/nntp/camel-nntp-folder.c +++ b/camel/providers/nntp/camel-nntp-folder.c @@ -511,7 +511,7 @@ camel_nntp_folder_new (CamelStore *parent, const char *folder_name, CamelExcepti g_free(root); root = g_strdup_printf("%s.ev-summary", nntp_folder->storage_path); - folder->summary = (CamelFolderSummary *) camel_nntp_summary_new (root); + folder->summary = (CamelFolderSummary *) camel_nntp_summary_new (folder, root); g_free(root); camel_folder_summary_load (folder->summary); diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c index bb2dda8809..213c6f9045 100644 --- a/camel/providers/nntp/camel-nntp-summary.c +++ b/camel/providers/nntp/camel-nntp-summary.c @@ -60,7 +60,7 @@ struct _CamelNNTPSummaryPrivate { #define _PRIVATE(o) (((CamelNNTPSummary *)(o))->priv) -static CamelMessageInfo * message_info_new (CamelFolderSummary *, struct _camel_header_raw *); +static CamelMessageInfo * message_info_new_from_header (CamelFolderSummary *, struct _camel_header_raw *); static int summary_header_load(CamelFolderSummary *, FILE *); static int summary_header_save(CamelFolderSummary *, FILE *); @@ -94,7 +94,7 @@ camel_nntp_summary_class_init(CamelNNTPSummaryClass *klass) camel_nntp_summary_parent = CAMEL_FOLDER_SUMMARY_CLASS(camel_type_get_global_classfuncs(camel_folder_summary_get_type())); - sklass->message_info_new = message_info_new; + sklass->message_info_new_from_header = message_info_new_from_header; sklass->summary_header_load = summary_header_load; sklass->summary_header_save = summary_header_save; } @@ -108,7 +108,7 @@ camel_nntp_summary_init(CamelNNTPSummary *obj) p = _PRIVATE(obj) = g_malloc0(sizeof(*p)); /* subclasses need to set the right instance data sizes */ - s->message_info_size = sizeof(CamelMessageInfo); + s->message_info_size = sizeof(CamelMessageInfoBase); s->content_info_size = sizeof(CamelMessageContentInfo); /* and a unique file version */ @@ -124,10 +124,12 @@ camel_nntp_summary_finalise(CamelObject *obj) } CamelNNTPSummary * -camel_nntp_summary_new(const char *path) +camel_nntp_summary_new(struct _CamelFolder *folder, const char *path) { CamelNNTPSummary *cns = (CamelNNTPSummary *)camel_object_new(camel_nntp_summary_get_type()); + ((CamelFolderSummary *)cns)->folder = folder; + camel_folder_summary_set_filename((CamelFolderSummary *)cns, path); camel_folder_summary_set_build_content((CamelFolderSummary *)cns, FALSE); @@ -135,9 +137,9 @@ camel_nntp_summary_new(const char *path) } static CamelMessageInfo * -message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h) +message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h) { - CamelMessageInfo *mi; + CamelMessageInfoBase *mi; CamelNNTPSummary *cns = (CamelNNTPSummary *)s; /* error to call without this setup */ @@ -147,13 +149,13 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h) /* we shouldn't be here if we already have this uid */ g_assert(camel_folder_summary_uid(s, cns->priv->uid) == NULL); - mi = ((CamelFolderSummaryClass *)camel_nntp_summary_parent)->message_info_new(s, h); + mi = (CamelMessageInfoBase *)((CamelFolderSummaryClass *)camel_nntp_summary_parent)->message_info_new_from_header(s, h); if (mi) { - camel_message_info_set_uid(mi, cns->priv->uid); + mi->uid = g_strdup(cns->priv->uid); cns->priv->uid = NULL; } - return mi; + return (CamelMessageInfo *)mi; } static int @@ -207,7 +209,7 @@ static int add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high, unsigned int low, CamelFolderChangeInfo *changes, CamelException *ex) { CamelFolderSummary *s; - CamelMessageInfo *mi; + CamelMessageInfoBase *mi; struct _camel_header_raw *headers = NULL; char *line, *tab; int len, ret; @@ -271,16 +273,16 @@ add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high, /* truncated line? ignore? */ if (xover == NULL) { - mi = camel_folder_summary_uid(s, cns->priv->uid); + mi = (CamelMessageInfoBase *)camel_folder_summary_uid(s, cns->priv->uid); if (mi == NULL) { - mi = camel_folder_summary_add_from_header(s, headers); + mi = (CamelMessageInfoBase *)camel_folder_summary_add_from_header(s, headers); if (mi) { mi->size = size; cns->high = n; camel_folder_change_info_add_uid(changes, camel_message_info_uid(mi)); } } else { - camel_folder_summary_info_free(s, mi); + camel_message_info_free(mi); } } @@ -352,7 +354,7 @@ add_range_head(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high, camel_folder_change_info_add_uid(changes, camel_message_info_uid(mi)); } else { /* already have, ignore */ - camel_folder_summary_info_free(s, mi); + camel_message_info_free(mi); } if (cns->priv->uid) { g_free(cns->priv->uid); @@ -445,7 +447,7 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelNNTPStore *store, char *lin i--; } - camel_folder_summary_info_free(s, mi); + camel_message_info_free(mi); } } cns->low = f; @@ -473,12 +475,12 @@ update: count = camel_folder_summary_count(s); for (i = 0; i < count; i++) { - CamelMessageInfo *mi = camel_folder_summary_index(s, i); + CamelMessageInfoBase *mi = (CamelMessageInfoBase *)camel_folder_summary_index(s, i); if (mi) { if ((mi->flags & CAMEL_MESSAGE_SEEN) == 0) unread++; - camel_folder_summary_info_free(s, mi); + camel_message_info_free(mi); } } diff --git a/camel/providers/nntp/camel-nntp-summary.h b/camel/providers/nntp/camel-nntp-summary.h index fb58cea75a..2aff4319e1 100644 --- a/camel/providers/nntp/camel-nntp-summary.h +++ b/camel/providers/nntp/camel-nntp-summary.h @@ -48,7 +48,7 @@ struct _CamelNNTPSummaryClass { }; CamelType camel_nntp_summary_get_type (void); -CamelNNTPSummary *camel_nntp_summary_new(const char *path); +CamelNNTPSummary *camel_nntp_summary_new(struct _CamelFolder *folder, const char *path); int camel_nntp_summary_check(CamelNNTPSummary *cns, struct _CamelNNTPStore *store, char *line, struct _CamelFolderChangeInfo *changes, struct _CamelException *ex); |