aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-19 21:54:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-20 01:07:21 +0800
commit62daae00eb589b4ac430c2215b9b21627787825d (patch)
tree6ee2f5e6bbb6615f95be5f6c4bcf2fb0e44c21c1
parent67227b428b5f730059ad9eefcc866fb4f4bf5e86 (diff)
downloadgsoc2013-evolution-62daae00eb589b4ac430c2215b9b21627787825d.tar
gsoc2013-evolution-62daae00eb589b4ac430c2215b9b21627787825d.tar.gz
gsoc2013-evolution-62daae00eb589b4ac430c2215b9b21627787825d.tar.bz2
gsoc2013-evolution-62daae00eb589b4ac430c2215b9b21627787825d.tar.lz
gsoc2013-evolution-62daae00eb589b4ac430c2215b9b21627787825d.tar.xz
gsoc2013-evolution-62daae00eb589b4ac430c2215b9b21627787825d.tar.zst
gsoc2013-evolution-62daae00eb589b4ac430c2215b9b21627787825d.zip
Add e_mail_part_attachment_ref_attachment().
-rw-r--r--em-format/e-mail-formatter-attachment.c12
-rw-r--r--em-format/e-mail-formatter-print.c2
-rw-r--r--em-format/e-mail-part-attachment.c9
-rw-r--r--em-format/e-mail-part-attachment.h2
4 files changed, 18 insertions, 7 deletions
diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c
index b7df8aae9b..7718090bb5 100644
--- a/em-format/e-mail-formatter-attachment.c
+++ b/em-format/e-mail-formatter-attachment.c
@@ -138,8 +138,8 @@ emfe_attachment_format (EMailFormatterExtension *extension,
EAttachment *attachment;
GList *head, *link;
- attachment = g_object_ref (
- E_MAIL_PART_ATTACHMENT (part)->attachment);
+ attachment = e_mail_part_attachment_ref_attachment (
+ E_MAIL_PART_ATTACHMENT (part));
head = g_queue_peek_head_link (&part->validities);
@@ -201,8 +201,8 @@ emfe_attachment_format (EMailFormatterExtension *extension,
const gchar *description;
const gchar *display_name;
- attachment = g_object_ref (
- E_MAIL_PART_ATTACHMENT (part)->attachment);
+ attachment = e_mail_part_attachment_ref_attachment (
+ E_MAIL_PART_ATTACHMENT (part));
fi = e_attachment_get_file_info (attachment);
display_name = g_file_info_get_display_name (fi);
@@ -374,8 +374,8 @@ emfe_attachment_get_widget (EMailFormatterExtension *extension,
g_return_val_if_fail (E_IS_MAIL_PART_ATTACHMENT (part), NULL);
- attachment = g_object_ref (
- E_MAIL_PART_ATTACHMENT (part)->attachment);
+ attachment = e_mail_part_attachment_ref_attachment (
+ E_MAIL_PART_ATTACHMENT (part));
part_id = e_mail_part_get_id (part);
diff --git a/em-format/e-mail-formatter-print.c b/em-format/e-mail-formatter-print.c
index 70689df4a5..a855ebc102 100644
--- a/em-format/e-mail-formatter-print.c
+++ b/em-format/e-mail-formatter-print.c
@@ -62,7 +62,7 @@ mail_formatter_print_write_attachments (EMailFormatter *formatter,
const gchar *display_name;
part = g_queue_pop_head (attachments);
- attachment = g_object_ref (part->attachment);
+ attachment = e_mail_part_attachment_ref_attachment (part);
file_info = e_attachment_get_file_info (attachment);
if (file_info == NULL) {
diff --git a/em-format/e-mail-part-attachment.c b/em-format/e-mail-part-attachment.c
index 2047f9d6b2..ef19a816d3 100644
--- a/em-format/e-mail-part-attachment.c
+++ b/em-format/e-mail-part-attachment.c
@@ -28,3 +28,12 @@ e_mail_part_attachment_free (EMailPartAttachment *empa)
empa->attachment_view_part_id = NULL;
}
}
+
+EAttachment *
+e_mail_part_attachment_ref_attachment (EMailPartAttachment *part)
+{
+ g_return_val_if_fail (part != NULL, NULL);
+
+ return g_object_ref (part->attachment);
+}
+
diff --git a/em-format/e-mail-part-attachment.h b/em-format/e-mail-part-attachment.h
index d44c599e4c..24f0cf2f06 100644
--- a/em-format/e-mail-part-attachment.h
+++ b/em-format/e-mail-part-attachment.h
@@ -43,6 +43,8 @@ typedef struct _EMailPartAttachment {
} EMailPartAttachment;
void e_mail_part_attachment_free (EMailPartAttachment *empa);
+EAttachment * e_mail_part_attachment_ref_attachment
+ (EMailPartAttachment *part);
G_END_DECLS