aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-04-04 04:55:23 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-04-04 11:06:39 +0800
commita8feedf3901a6db06e810f0dfd6ef370b23a2718 (patch)
tree7037c865bae26f0abcf71500cedb62db130a12d5 /mail
parent26240e0b180bdaf92702e513a21da2f859883fb3 (diff)
downloadgsoc2013-evolution-a8feedf3901a6db06e810f0dfd6ef370b23a2718.tar
gsoc2013-evolution-a8feedf3901a6db06e810f0dfd6ef370b23a2718.tar.gz
gsoc2013-evolution-a8feedf3901a6db06e810f0dfd6ef370b23a2718.tar.bz2
gsoc2013-evolution-a8feedf3901a6db06e810f0dfd6ef370b23a2718.tar.lz
gsoc2013-evolution-a8feedf3901a6db06e810f0dfd6ef370b23a2718.tar.xz
gsoc2013-evolution-a8feedf3901a6db06e810f0dfd6ef370b23a2718.tar.zst
gsoc2013-evolution-a8feedf3901a6db06e810f0dfd6ef370b23a2718.zip
Adapt to Camel API changes.
Diffstat (limited to 'mail')
-rw-r--r--mail/em-composer-utils.c22
-rw-r--r--mail/em-format-html-display.c2
-rw-r--r--mail/em-format-html.c48
-rw-r--r--mail/em-inline-filter.c2
-rw-r--r--mail/em-utils.c11
-rw-r--r--mail/mail-autofilter.c2
-rw-r--r--mail/mail-ops.c15
-rw-r--r--mail/mail-tools.c4
8 files changed, 57 insertions, 49 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index ec6ab34088..c9a8a30c78 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -868,7 +868,7 @@ replace_variables (GSList *clues, CamelMimeMessage *message, gchar **pstr)
}
if (!count1) {
- const CamelInternetAddress *to;
+ CamelInternetAddress *to;
const gchar *name, *addr;
to = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO);
@@ -925,7 +925,7 @@ traverse_parts (GSList *clues, CamelMimeMessage *message, CamelDataWrapper *cont
CamelStream *mem;
gchar *str;
- content = camel_medium_get_content_object (CAMEL_MEDIUM (part));
+ content = camel_medium_get_content (CAMEL_MEDIUM (part));
if (!content)
return;
@@ -972,7 +972,7 @@ edit_message (CamelMimeMessage *message, CamelFolder *drafts, const gchar *uid)
clue_list = gconf_client_get_list ( gconf, GCONF_KEY_TEMPLATE_PLACEHOLDERS, GCONF_VALUE_STRING, NULL );
g_object_unref (gconf);
- traverse_parts (clue_list, message, camel_medium_get_content_object (CAMEL_MEDIUM (message)));
+ traverse_parts (clue_list, message, camel_medium_get_content (CAMEL_MEDIUM (message)));
g_slist_foreach (clue_list, (GFunc) g_free, NULL);
g_slist_free (clue_list);
@@ -1224,7 +1224,7 @@ forward_non_attached (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages,
composer = create_new_composer (subject, fromuri, FALSE);
if (composer) {
- if (CAMEL_IS_MULTIPART(camel_medium_get_content_object((CamelMedium *)message)))
+ if (CAMEL_IS_MULTIPART(camel_medium_get_content ((CamelMedium *)message)))
e_msg_composer_add_message_attachments(composer, message, FALSE);
e_msg_composer_set_body_text (composer, text, len);
@@ -1574,7 +1574,7 @@ em_utils_send_receipt (CamelFolder *folder, CamelMimeMessage *message)
camel_object_unref (stream);
part = camel_mime_part_new ();
- camel_medium_set_content_object (CAMEL_MEDIUM (part), receipt_text);
+ camel_medium_set_content (CAMEL_MEDIUM (part), receipt_text);
camel_mime_part_set_encoding (part, CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE);
camel_object_unref (receipt_text);
camel_multipart_add_part (body, part);
@@ -1605,14 +1605,14 @@ em_utils_send_receipt (CamelFolder *folder, CamelMimeMessage *message)
g_free (recipient);
g_free (fake_msgid);
- camel_medium_set_content_object (CAMEL_MEDIUM (part), receipt_data);
+ camel_medium_set_content (CAMEL_MEDIUM (part), receipt_data);
camel_mime_part_set_encoding (part, CAMEL_TRANSFER_ENCODING_7BIT);
camel_object_unref (receipt_data);
camel_multipart_add_part (body, part);
camel_object_unref (part);
/* Finish creating the message */
- camel_medium_set_content_object (CAMEL_MEDIUM (receipt), CAMEL_DATA_WRAPPER (body));
+ camel_medium_set_content (CAMEL_MEDIUM (receipt), CAMEL_DATA_WRAPPER (body));
camel_object_unref (body);
/* Translators: %s is the subject of the email message */
@@ -1764,7 +1764,7 @@ reply_get_composer (CamelMimeMessage *message, EAccount *account,
static void
get_reply_sender (CamelMimeMessage *message, CamelInternetAddress *to, CamelNNTPAddress *postto)
{
- const CamelInternetAddress *reply_to;
+ CamelInternetAddress *reply_to;
const gchar *name, *addr, *posthdr;
gint i;
@@ -1833,7 +1833,7 @@ get_reply_list (CamelMimeMessage *message, CamelInternetAddress *to)
}
static void
-concat_unique_addrs (CamelInternetAddress *dest, const CamelInternetAddress *src, GHashTable *rcpt_hash)
+concat_unique_addrs (CamelInternetAddress *dest, CamelInternetAddress *src, GHashTable *rcpt_hash)
{
const gchar *name, *addr;
gint i;
@@ -1849,7 +1849,7 @@ concat_unique_addrs (CamelInternetAddress *dest, const CamelInternetAddress *src
static void
get_reply_all (CamelMimeMessage *message, CamelInternetAddress *to, CamelInternetAddress *cc, CamelNNTPAddress *postto)
{
- const CamelInternetAddress *reply_to, *to_addrs, *cc_addrs;
+ CamelInternetAddress *reply_to, *to_addrs, *cc_addrs;
const gchar *name, *addr, *posthdr;
GHashTable *rcpt_hash;
gint i;
@@ -1933,7 +1933,7 @@ typedef void (* AttribFormatter) (GString *str, const gchar *attr, CamelMimeMess
static void
format_sender (GString *str, const gchar *attr, CamelMimeMessage *message)
{
- const CamelInternetAddress *sender;
+ CamelInternetAddress *sender;
const gchar *name, *addr = NULL;
sender = camel_mime_message_get_from (message);
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index e93b51744a..d32ee8dd9f 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -676,7 +676,7 @@ efhd_builtin_init(EMFormatHTMLDisplayClass *efhc)
static void
efhd_write_image(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
{
- CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)puri->part);
+ CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *)puri->part);
/* TODO: identical to efh_write_image */
d(printf("writing image '%s'\n", puri->cid));
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 3e9a26afca..2a09d713a9 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -667,17 +667,18 @@ efh_format_source (EMFormat *emf,
CamelStream *stream,
CamelMimePart *part)
{
- CamelStreamFilter *filtered_stream;
+ CamelStream *filtered_stream;
CamelMimeFilter *filter;
CamelDataWrapper *dw = (CamelDataWrapper *) part;
- filtered_stream = camel_stream_filter_new_with_stream (stream);
+ filtered_stream = camel_stream_filter_new (stream);
filter = camel_mime_filter_tohtml_new (
CAMEL_MIME_FILTER_TOHTML_CONVERT_NL |
CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES |
CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT, 0);
- camel_stream_filter_add (filtered_stream, filter);
+ camel_stream_filter_add (
+ CAMEL_STREAM_FILTER (filtered_stream), filter);
camel_object_unref (filter);
camel_stream_write_string (stream, "<table><tr><td><tt>");
@@ -881,7 +882,7 @@ efh_class_init (EMFormatHTMLClass *class)
/* cache expiry - 2 hour access, 1 day max */
pathname = g_build_filename (
e_get_user_data_dir (), "cache", NULL);
- emfh_http_cache = camel_data_cache_new (pathname, 0, NULL);
+ emfh_http_cache = camel_data_cache_new (pathname, NULL);
if (emfh_http_cache) {
camel_data_cache_set_expire_age(emfh_http_cache, 24*60*60);
camel_data_cache_set_expire_access(emfh_http_cache, 2*60*60);
@@ -1190,7 +1191,7 @@ em_format_html_file_part(EMFormatHTML *efh, const gchar *mime_type, const gchar
if (mime_type)
camel_data_wrapper_set_mime_type(dw, mime_type);
part = camel_mime_part_new();
- camel_medium_set_content_object((CamelMedium *)part, dw);
+ camel_medium_set_content ((CamelMedium *)part, dw);
camel_object_unref(dw);
basename = g_path_get_basename (filename);
camel_mime_part_set_filename(part, basename);
@@ -1449,7 +1450,7 @@ efh_url_requested(GtkHTML *html, const gchar *url, GtkHTMLStream *handle, EMForm
puri = em_format_find_visible_puri((EMFormat *)efh, url);
if (puri) {
- CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)puri->part);
+ CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *)puri->part);
CamelContentType *ct = dw?dw->mime_type:NULL;
/* GtkHTML only handles text and images.
@@ -1616,7 +1617,7 @@ efh_text_plain (EMFormatHTML *efh,
const EMFormatHandler *info,
gboolean is_fallback)
{
- CamelStreamFilter *filtered_stream;
+ CamelStream *filtered_stream;
CamelMimeFilter *html_filter;
CamelMultipart *mp;
CamelDataWrapper *dw;
@@ -1629,7 +1630,7 @@ efh_text_plain (EMFormatHTML *efh,
flags = efh->text_html_flags;
- dw = camel_medium_get_content_object((CamelMedium *)part);
+ dw = camel_medium_get_content ((CamelMedium *)part);
/* Check for RFC 2646 flowed text. */
if (camel_content_type_is(dw->mime_type, "text", "plain")
@@ -1663,10 +1664,12 @@ efh_text_plain (EMFormatHTML *efh,
}
null = camel_stream_null_new();
- filtered_stream = camel_stream_filter_new_with_stream(null);
+ filtered_stream = camel_stream_filter_new (null);
camel_object_unref(null);
inline_filter = em_inline_filter_new(camel_mime_part_get_encoding(part), ct);
- camel_stream_filter_add(filtered_stream, (CamelMimeFilter *)inline_filter);
+ camel_stream_filter_add (
+ CAMEL_STREAM_FILTER (filtered_stream),
+ CAMEL_MIME_FILTER (inline_filter));
camel_data_wrapper_write_to_stream(dw, (CamelStream *)filtered_stream);
camel_stream_close((CamelStream *)filtered_stream);
camel_object_unref(filtered_stream);
@@ -1682,9 +1685,10 @@ efh_text_plain (EMFormatHTML *efh,
rgb = e_color_to_value (
&efh->priv->colors[EM_FORMAT_HTML_COLOR_CITATION]);
- filtered_stream = camel_stream_filter_new_with_stream(stream);
+ filtered_stream = camel_stream_filter_new (stream);
html_filter = camel_mime_filter_tohtml_new(flags, rgb);
- camel_stream_filter_add(filtered_stream, html_filter);
+ camel_stream_filter_add (
+ CAMEL_STREAM_FILTER (filtered_stream), html_filter);
camel_object_unref(html_filter);
/* We handle our made-up multipart here, so we don't recursively call ourselves */
@@ -1728,7 +1732,7 @@ efh_text_plain (EMFormatHTML *efh,
static void
efh_text_enriched(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info)
{
- CamelStreamFilter *filtered_stream;
+ CamelStream *filtered_stream;
CamelMimeFilter *enriched;
guint32 flags = 0;
@@ -1740,8 +1744,9 @@ efh_text_enriched(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, E
}
enriched = camel_mime_filter_enriched_new(flags);
- filtered_stream = camel_stream_filter_new_with_stream (stream);
- camel_stream_filter_add(filtered_stream, enriched);
+ filtered_stream = camel_stream_filter_new (stream);
+ camel_stream_filter_add (
+ CAMEL_STREAM_FILTER (filtered_stream), enriched);
camel_object_unref(enriched);
camel_stream_printf (
@@ -1773,7 +1778,7 @@ efh_write_text_html(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
fd = dup(STDOUT_FILENO);
out = camel_stream_fs_new_with_fd(fd);
printf("writing text content to frame '%s'\n", puri->cid);
- dw = camel_medium_get_content_object(puri->part);
+ dw = camel_medium_get_content (puri->part);
if (dw)
camel_data_wrapper_write_to_stream(dw, out);
camel_object_unref(out);
@@ -1930,7 +1935,7 @@ fail:
static void
efh_message_deliverystatus(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info)
{
- CamelStreamFilter *filtered_stream;
+ CamelStream *filtered_stream;
CamelMimeFilter *html_filter;
guint32 rgb = 0x737373;
@@ -1947,9 +1952,10 @@ efh_message_deliverystatus(EMFormatHTML *efh, CamelStream *stream, CamelMimePart
&efh->priv->colors[
EM_FORMAT_HTML_COLOR_TEXT]));
- filtered_stream = camel_stream_filter_new_with_stream(stream);
+ filtered_stream = camel_stream_filter_new (stream);
html_filter = camel_mime_filter_tohtml_new(efh->text_html_flags, rgb);
- camel_stream_filter_add(filtered_stream, html_filter);
+ camel_stream_filter_add (
+ CAMEL_STREAM_FILTER (filtered_stream), html_filter);
camel_object_unref(html_filter);
camel_stream_write_string(stream, "<tt>\n" EFH_MESSAGE_START);
@@ -2013,7 +2019,7 @@ emfh_multipart_related_check(struct _EMFormatHTMLJob *job, gint cancelled)
static void
efh_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info)
{
- CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)part);
+ CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)part);
CamelMimePart *body_part, *display_part = NULL;
CamelContentType *content_type;
const gchar *start;
@@ -2089,7 +2095,7 @@ efh_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, c
static void
efh_write_image(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
{
- CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)puri->part);
+ CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *)puri->part);
d(printf("writing image '%s'\n", puri->cid));
camel_data_wrapper_decode_to_stream(dw, stream);
diff --git a/mail/em-inline-filter.c b/mail/em-inline-filter.c
index 44187551f1..55a43caf83 100644
--- a/mail/em-inline-filter.c
+++ b/mail/em-inline-filter.c
@@ -164,7 +164,7 @@ emif_add_part(EMInlineFilter *emif, const gchar *data, gint len)
dw->encoding = encoding;
part = camel_mime_part_new();
- camel_medium_set_content_object((CamelMedium *)part, dw);
+ camel_medium_set_content ((CamelMedium *)part, dw);
camel_mime_part_set_encoding(part, encoding);
camel_object_unref(dw);
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 8c83382251..ff4487c2d4 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -542,13 +542,14 @@ em_utils_flag_for_followup_completed (GtkWindow *parent, CamelFolder *folder, GP
static gint
em_utils_write_messages_to_stream(CamelFolder *folder, GPtrArray *uids, CamelStream *stream)
{
- CamelStreamFilter *filtered_stream;
- CamelMimeFilterFrom *from_filter;
+ CamelStream *filtered_stream;
+ CamelMimeFilter *from_filter;
gint i, res = 0;
from_filter = camel_mime_filter_from_new();
- filtered_stream = camel_stream_filter_new_with_stream(stream);
- camel_stream_filter_add(filtered_stream, (CamelMimeFilter *)from_filter);
+ filtered_stream = camel_stream_filter_new (stream);
+ camel_stream_filter_add (
+ CAMEL_STREAM_FILTER (filtered_stream), from_filter);
camel_object_unref(from_filter);
for (i=0; i<uids->len; i++) {
@@ -2198,7 +2199,7 @@ em_utils_guess_account_with_recipients (CamelMimeMessage *message,
EAccountList *account_list;
GHashTable *recipients;
EIterator *iter;
- const CamelInternetAddress *addr;
+ CamelInternetAddress *addr;
const gchar *type;
const gchar *key;
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index dd0423ae07..f2422ce217 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -259,7 +259,7 @@ rule_from_message (EFilterRule *rule, ERuleContext *context, CamelMimeMessage *m
}
/* should parse the from address into an internet address? */
if (flags & AUTO_FROM) {
- const CamelInternetAddress *from;
+ CamelInternetAddress *from;
gint i;
const gchar *name, *address;
gchar *namestr;
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index c147d22233..3aa310b2f0 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -1182,7 +1182,7 @@ do_build_attachment (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages,
camel_object_unref(part);
}
part = camel_mime_part_new();
- camel_medium_set_content_object(CAMEL_MEDIUM (part), CAMEL_DATA_WRAPPER(multipart));
+ camel_medium_set_content (CAMEL_MEDIUM (part), CAMEL_DATA_WRAPPER(multipart));
camel_object_unref(multipart);
camel_mime_part_set_description(part, _("Forwarded messages"));
@@ -2053,7 +2053,7 @@ save_prepare_part (CamelMimePart *mime_part)
CamelDataWrapper *wrapper;
gint parts, i;
- wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part));
+ wrapper = camel_medium_get_content (CAMEL_MEDIUM (mime_part));
if (!wrapper)
return;
@@ -2082,8 +2082,8 @@ save_prepare_part (CamelMimePart *mime_part)
static void
save_messages_exec (struct _save_messages_msg *m)
{
- CamelStreamFilter *filtered_stream;
- CamelMimeFilterFrom *from_filter;
+ CamelStream *filtered_stream;
+ CamelMimeFilter *from_filter;
CamelStream *stream;
gint i;
gchar *from, *path;
@@ -2095,8 +2095,9 @@ save_messages_exec (struct _save_messages_msg *m)
stream = camel_stream_vfs_new_with_uri (path, CAMEL_STREAM_VFS_CREATE);
from_filter = camel_mime_filter_from_new();
- filtered_stream = camel_stream_filter_new_with_stream(stream);
- camel_stream_filter_add(filtered_stream, (CamelMimeFilter *)from_filter);
+ filtered_stream = camel_stream_filter_new (stream);
+ camel_stream_filter_add (
+ CAMEL_STREAM_FILTER (filtered_stream), from_filter);
camel_object_unref(from_filter);
if (path != m->path)
@@ -2230,7 +2231,7 @@ save_part_exec (struct _save_part_msg *m)
if (path != m->path)
g_free (path);
- content = camel_medium_get_content_object (CAMEL_MEDIUM (m->part));
+ content = camel_medium_get_content (CAMEL_MEDIUM (m->part));
if (camel_data_wrapper_decode_to_stream (content, stream) == -1
|| camel_stream_flush (stream) == -1)
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 7ccf50cc08..92677a4d5a 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -266,8 +266,8 @@ mail_tool_make_message_attachment (CamelMimeMessage *message)
part = camel_mime_part_new ();
camel_mime_part_set_disposition (part, "inline");
camel_mime_part_set_description (part, desc);
- camel_medium_set_content_object (CAMEL_MEDIUM (part),
- CAMEL_DATA_WRAPPER (message));
+ camel_medium_set_content (
+ CAMEL_MEDIUM (part), CAMEL_DATA_WRAPPER (message));
camel_mime_part_set_content_type (part, "message/rfc822");
g_free (desc);