aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-23 00:11:49 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-24 04:36:01 +0800
commit256422cab27d0b7adbe99fdeaceb72cd78c129bb (patch)
tree8d087e570e7656e7d088232d98c52636c95baed0 /em-format
parent37c5951635a4f45ba26b0f95ce7af61275d47fba (diff)
downloadgsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.gz
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.bz2
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.lz
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.xz
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.zst
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.zip
Attachment-related cleanups.
Diffstat (limited to 'em-format')
-rw-r--r--em-format/e-mail-formatter-attachment.c6
-rw-r--r--em-format/e-mail-parser.c18
2 files changed, 13 insertions, 11 deletions
diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c
index 0a100e0987..1003b55eef 100644
--- a/em-format/e-mail-formatter-attachment.c
+++ b/em-format/e-mail-formatter-attachment.c
@@ -209,7 +209,7 @@ emfe_attachment_format (EMailFormatterExtension *extension,
display_name = g_file_info_get_display_name (fi);
description = e_attachment_get_description (attachment);
- if (description && *description) {
+ if (description != NULL && *description != '\0') {
name = g_strdup_printf (
"<h2>Attachment: %s (%s)</h2>\n",
description, display_name);
@@ -219,7 +219,9 @@ emfe_attachment_format (EMailFormatterExtension *extension,
display_name);
}
- camel_stream_write_string (stream, name, cancellable, NULL);
+ camel_stream_write_string (
+ stream, name, cancellable, NULL);
+
g_free (name);
g_object_unref (attachment);
diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c
index 929662f943..f31e0ca199 100644
--- a/em-format/e-mail-parser.c
+++ b/em-format/e-mail-parser.c
@@ -732,22 +732,22 @@ e_mail_parser_wrap_as_attachment (EMailParser *parser,
NULL);
if (size != 0) {
- GFileInfo *fileinfo;
+ GFileInfo *file_info;
- fileinfo = e_attachment_get_file_info (attachment);
+ file_info = e_attachment_get_file_info (attachment);
- if (!fileinfo) {
- fileinfo = g_file_info_new ();
+ if (file_info == NULL) {
+ file_info = g_file_info_new ();
g_file_info_set_content_type (
- fileinfo, empa->snoop_mime_type);
+ file_info, empa->snoop_mime_type);
} else {
- g_object_ref (fileinfo);
+ g_object_ref (file_info);
}
- g_file_info_set_size (fileinfo, size);
- e_attachment_set_file_info (attachment, fileinfo);
+ g_file_info_set_size (file_info, size);
+ e_attachment_set_file_info (attachment, file_info);
- g_object_unref (fileinfo);
+ g_object_unref (file_info);
}
g_object_unref (attachment);