aboutsummaryrefslogtreecommitdiffstats
path: root/modules/vcard-inline/e-mail-formatter-vcard.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2014-02-25 23:23:11 +0800
committerMatthew Barnes <mbarnes@redhat.com>2014-03-01 03:38:11 +0800
commitf4bb7d7748f3c407858e9c844d365411c586d861 (patch)
tree5946af137b2439857433fd9729ba758e9cd3c05d /modules/vcard-inline/e-mail-formatter-vcard.c
parentc3f8c95322ca7e461444820c7469d5527c239b05 (diff)
downloadgsoc2013-evolution-f4bb7d7748f3c407858e9c844d365411c586d861.tar
gsoc2013-evolution-f4bb7d7748f3c407858e9c844d365411c586d861.tar.gz
gsoc2013-evolution-f4bb7d7748f3c407858e9c844d365411c586d861.tar.bz2
gsoc2013-evolution-f4bb7d7748f3c407858e9c844d365411c586d861.tar.lz
gsoc2013-evolution-f4bb7d7748f3c407858e9c844d365411c586d861.tar.xz
gsoc2013-evolution-f4bb7d7748f3c407858e9c844d365411c586d861.tar.zst
gsoc2013-evolution-f4bb7d7748f3c407858e9c844d365411c586d861.zip
EMailFormatter: Use GOutputStream instead of CamelStream.
Diffstat (limited to 'modules/vcard-inline/e-mail-formatter-vcard.c')
-rw-r--r--modules/vcard-inline/e-mail-formatter-vcard.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/modules/vcard-inline/e-mail-formatter-vcard.c b/modules/vcard-inline/e-mail-formatter-vcard.c
index 773bf68295..f13d677c29 100644
--- a/modules/vcard-inline/e-mail-formatter-vcard.c
+++ b/modules/vcard-inline/e-mail-formatter-vcard.c
@@ -60,7 +60,7 @@ mail_formatter_vcard_format (EMailFormatterExtension *extension,
EMailFormatter *formatter,
EMailFormatterContext *context,
EMailPart *part,
- CamelStream *stream,
+ GOutputStream *stream,
GCancellable *cancellable)
{
EMailPartVCard *vcard_part;
@@ -80,8 +80,10 @@ mail_formatter_vcard_format (EMailFormatterExtension *extension,
eab_contact_formatter_format_contact (
vcard_part->formatter, contact, buffer);
- camel_stream_write_string (
- stream, buffer->str, cancellable, NULL);
+
+ g_output_stream_write_all (
+ stream, buffer->str, buffer->len,
+ NULL, cancellable, NULL);
g_string_free (buffer, TRUE);
@@ -94,7 +96,8 @@ mail_formatter_vcard_format (EMailFormatterExtension *extension,
const gchar *label = NULL;
EABContactDisplayMode mode;
const gchar *info = NULL;
- gchar *html_label, *access_key;
+ gchar *access_key = NULL;
+ gchar *html_label;
length = g_slist_length (vcard_part->contact_list);
@@ -134,11 +137,12 @@ mail_formatter_vcard_format (EMailFormatterExtension *extension,
str = g_strdup_printf (
"<div id=\"%s\">",
e_mail_part_get_id (part));
- camel_stream_write_string (stream, str, cancellable, NULL);
+ g_output_stream_write_all (
+ stream, str, strlen (str), NULL, cancellable, NULL);
g_free (str);
html_label = e_mail_formatter_parse_html_mnemonics (
- label, &access_key);
+ label, &access_key);
str = g_strdup_printf (
"<button type=\"button\" "
"name=\"set-display-mode\" "
@@ -146,11 +150,13 @@ mail_formatter_vcard_format (EMailFormatterExtension *extension,
"value=\"%d\" "
"accesskey=\"%s\">%s</button>",
mode, access_key, html_label);
- camel_stream_write_string (stream, str, cancellable, NULL);
+ g_output_stream_write_all (
+ stream, str, strlen (str), NULL, cancellable, NULL);
g_free (str);
g_free (html_label);
- if (access_key)
- g_free (access_key);
+
+ g_free (access_key);
+ access_key = NULL;
html_label = e_mail_formatter_parse_html_mnemonics (
_("Save _To Addressbook"), &access_key);
@@ -166,18 +172,18 @@ mail_formatter_vcard_format (EMailFormatterExtension *extension,
e_mail_part_get_id (part),
access_key, html_label, uri,
e_mail_part_get_id (part));
- camel_stream_write_string (stream, str, cancellable, NULL);
+ g_output_stream_write_all (
+ stream, str, strlen (str), NULL, cancellable, NULL);
g_free (str);
g_free (html_label);
- if (access_key)
- g_free (access_key);
- if (length == 2) {
+ g_free (access_key);
+ access_key = NULL;
+ if (length == 2) {
info = _("There is one other contact.");
} else if (length > 2) {
-
/* Translators: This will always be two or more. */
info = g_strdup_printf (ngettext (
"There is %d other contact.",
@@ -186,12 +192,13 @@ mail_formatter_vcard_format (EMailFormatterExtension *extension,
}
if (info) {
-
str = g_strdup_printf (
"<div class=\"attachment-info\">%s</div>",
info);
- camel_stream_write_string (stream, str, cancellable, NULL);
+ g_output_stream_write_all (
+ stream, str, strlen (str),
+ NULL, cancellable, NULL);
g_free (str);
}