[evolution-data-server] Remove camel_folder_summary_add_from_parser().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Remove camel_folder_summary_add_from_parser().
- Date: Mon, 23 Sep 2013 16:06:23 +0000 (UTC)
commit bb2a3f9628e62d9d62769202b88c6d8522164eaf
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Sep 19 15:50:34 2013 -0400
Remove camel_folder_summary_add_from_parser().
Trivial function, not worth the API bloat. Do this instead:
info = camel_folder_summary_info_new_from_parser (summary, parser);
camel_folder_summary_add (summary, info);
camel/camel-folder-summary.c | 29 -------------------------
camel/camel-folder-summary.h | 4 ---
camel/providers/local/camel-maildir-summary.c | 15 +++++++++---
camel/providers/local/camel-mbox-summary.c | 21 +----------------
camel/providers/local/camel-mh-summary.c | 15 +++++++++---
camel/providers/nntp/camel-nntp-summary.c | 3 +-
docs/reference/camel/camel-sections.txt | 1 -
7 files changed, 26 insertions(+), 62 deletions(-)
---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index e7babf7..a3668cd 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -2994,35 +2994,6 @@ camel_folder_summary_insert (CamelFolderSummary *summary,
}
/**
- * camel_folder_summary_add_from_parser:
- * @summary: a #CamelFolderSummary object
- * @parser: a #CamelMimeParser object
- *
- * Build a new info record based on the current position of a #CamelMimeParser.
- *
- * The parser should be positioned before the start of the message to summarise.
- * This function may be used if build_contnet_info or an index has been
- * specified for the summary.
- *
- * Returns: the newly added record
- **/
-CamelMessageInfo *
-camel_folder_summary_add_from_parser (CamelFolderSummary *summary,
- CamelMimeParser *mp)
-{
- CamelMessageInfo *info;
-
- g_return_val_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary), NULL);
- g_return_val_if_fail (CAMEL_IS_MIME_PARSER (mp), NULL);
-
- info = camel_folder_summary_info_new_from_parser (summary, mp);
-
- camel_folder_summary_add (summary, info);
-
- return info;
-}
-
-/**
* camel_folder_summary_add_from_message:
* @summary: a #CamelFolderSummary object
* @message: a #CamelMimeMessage object
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 19c3855..25bda2b 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -456,10 +456,6 @@ void camel_folder_summary_add_preview
/* build/add raw summary items */
CamelMessageInfo *
- camel_folder_summary_add_from_parser
- (CamelFolderSummary *summary,
- CamelMimeParser *parser);
-CamelMessageInfo *
camel_folder_summary_add_from_message
(CamelFolderSummary *summary,
CamelMimeMessage *message);
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index bd053ae..7b4d97d 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -501,6 +501,8 @@ camel_maildir_summary_add (CamelLocalSummary *cls,
gint forceindex,
GCancellable *cancellable)
{
+ CamelMessageInfo *info;
+ CamelFolderSummary *summary;
CamelMaildirSummary *maildirs = (CamelMaildirSummary *) cls;
gchar *filename = g_strdup_printf ("%s/cur/%s", cls->folder_path, name);
gint fd;
@@ -508,6 +510,8 @@ camel_maildir_summary_add (CamelLocalSummary *cls,
d (printf ("summarising: %s\n", name));
+ summary = CAMEL_FOLDER_SUMMARY (cls);
+
fd = open (filename, O_RDONLY | O_LARGEFILE);
if (fd == -1) {
g_warning ("Cannot summarise/index: %s: %s", filename, g_strerror (errno));
@@ -519,15 +523,18 @@ camel_maildir_summary_add (CamelLocalSummary *cls,
camel_mime_parser_init_with_fd (mp, fd);
if (cls->index && (forceindex || !camel_index_has_name (cls->index, name))) {
d (printf ("forcing indexing of message content\n"));
- camel_folder_summary_set_index ((CamelFolderSummary *) maildirs, cls->index);
+ camel_folder_summary_set_index (summary, cls->index);
} else {
- camel_folder_summary_set_index ((CamelFolderSummary *) maildirs, NULL);
+ camel_folder_summary_set_index (summary, NULL);
}
maildirs->priv->current_file = (gchar *) name;
- camel_folder_summary_add_from_parser ((CamelFolderSummary *) maildirs, mp);
+
+ info = camel_folder_summary_info_new_from_parser (summary, mp);
+ camel_folder_summary_add (summary, info);
+
g_object_unref (mp);
maildirs->priv->current_file = NULL;
- camel_folder_summary_set_index ((CamelFolderSummary *) maildirs, NULL);
+ camel_folder_summary_set_index (summary, NULL);
g_free (filename);
return 0;
}
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 516914a..bbe04aa 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -506,25 +506,8 @@ summary_update (CamelLocalSummary *cls,
camel_operation_progress (
cancellable, (gint) (((gfloat) pc / size) * 100));
- info = camel_folder_summary_add_from_parser (s, mp);
- if (info == NULL) {
- gchar *pos_str;
-
- /* XXX Gettext does not understand G_GINT64_FORMAT
- * when used directly in a translatable string,
- * so we have to pre-format the position value
- * for use in the error message. */
- pos_str = g_strdup_printf (
- "%" G_GINT64_FORMAT, (gint64)
- camel_mime_parser_tell (mp));
- g_set_error (
- error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
- _("Fatal mail parser error near position %s "
- "in folder %s"), pos_str, cls->folder_path);
- g_free (pos_str);
- ok = -1;
- break;
- }
+ info = camel_folder_summary_info_new_from_parser (s, mp);
+ camel_folder_summary_add (s, info);
g_assert (camel_mime_parser_step (mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM_END);
}
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index dd22b17..4c9a00c 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -154,11 +154,15 @@ camel_mh_summary_add (CamelLocalSummary *cls,
gint forceindex,
GCancellable *cancellable)
{
+ CamelMessageInfo *info;
+ CamelFolderSummary *summary;
CamelMhSummary *mhs = (CamelMhSummary *) cls;
gchar *filename = g_strdup_printf ("%s/%s", cls->folder_path, name);
gint fd;
CamelMimeParser *mp;
+ summary = CAMEL_FOLDER_SUMMARY (cls);
+
d (printf ("summarising: %s\n", name));
fd = open (filename, O_RDONLY | O_LARGEFILE);
@@ -172,15 +176,18 @@ camel_mh_summary_add (CamelLocalSummary *cls,
camel_mime_parser_init_with_fd (mp, fd);
if (cls->index && (forceindex || !camel_index_has_name (cls->index, name))) {
d (printf ("forcing indexing of message content\n"));
- camel_folder_summary_set_index ((CamelFolderSummary *) mhs, cls->index);
+ camel_folder_summary_set_index (summary, cls->index);
} else {
- camel_folder_summary_set_index ((CamelFolderSummary *) mhs, NULL);
+ camel_folder_summary_set_index (summary, NULL);
}
mhs->priv->current_uid = (gchar *) name;
- camel_folder_summary_add_from_parser ((CamelFolderSummary *) mhs, mp);
+
+ info = camel_folder_summary_info_new_from_parser (summary, mp);
+ camel_folder_summary_add (summary, info);
+
g_object_unref (mp);
mhs->priv->current_uid = NULL;
- camel_folder_summary_set_index ((CamelFolderSummary *) mhs, NULL);
+ camel_folder_summary_set_index (summary, NULL);
g_free (filename);
return 0;
}
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index e85d415..5cba381 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -373,7 +373,8 @@ add_range_head (CamelNNTPSummary *cns,
if (!camel_folder_summary_check_uid (s, cns->priv->uid)) {
if (camel_mime_parser_init_with_stream (mp, CAMEL_STREAM (nntp_stream),
error) == -1)
goto error;
- mi = camel_folder_summary_add_from_parser (s, mp);
+ mi = camel_folder_summary_info_new_from_parser (s, mp);
+ camel_folder_summary_add (s, mi);
while (camel_mime_parser_step (mp, NULL, NULL) != CAMEL_MIME_PARSER_STATE_EOF)
;
if (mi == NULL) {
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 13070b8..d6e9911 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -607,7 +607,6 @@ camel_folder_summary_info_new_from_message
camel_folder_summary_content_info_new
camel_folder_summary_content_info_free
camel_folder_summary_add_preview
-camel_folder_summary_add_from_parser
camel_folder_summary_add_from_message
camel_folder_summary_add
camel_folder_summary_insert
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]