aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail/e-mail-attachment-handler.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-09-12 22:50:53 +0800
committerMilan Crha <mcrha@redhat.com>2012-09-12 22:50:53 +0800
commit146f9f653f78d6a5cbb5e0622707a8bdca6ee996 (patch)
tree850789a8419857969e142a6e8d699a0dd78e86d2 /modules/mail/e-mail-attachment-handler.c
parent84313cdc37b7ad5f13fa0c39fcdf54a19212501b (diff)
downloadgsoc2013-evolution-146f9f653f78d6a5cbb5e0622707a8bdca6ee996.tar
gsoc2013-evolution-146f9f653f78d6a5cbb5e0622707a8bdca6ee996.tar.gz
gsoc2013-evolution-146f9f653f78d6a5cbb5e0622707a8bdca6ee996.tar.bz2
gsoc2013-evolution-146f9f653f78d6a5cbb5e0622707a8bdca6ee996.tar.lz
gsoc2013-evolution-146f9f653f78d6a5cbb5e0622707a8bdca6ee996.tar.xz
gsoc2013-evolution-146f9f653f78d6a5cbb5e0622707a8bdca6ee996.tar.zst
gsoc2013-evolution-146f9f653f78d6a5cbb5e0622707a8bdca6ee996.zip
Avoid code duplication for reply on message attachment
Diffstat (limited to 'modules/mail/e-mail-attachment-handler.c')
-rw-r--r--modules/mail/e-mail-attachment-handler.c44
1 files changed, 11 insertions, 33 deletions
diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c
index b3e14328e4..69cbfe6d73 100644
--- a/modules/mail/e-mail-attachment-handler.c
+++ b/modules/mail/e-mail-attachment-handler.c
@@ -97,8 +97,8 @@ mail_attachment_handler_forward (GtkAction *action,
}
static void
-mail_attachment_handler_reply_all (GtkAction *action,
- EAttachmentHandler *handler)
+mail_attachment_handler_reply (EAttachmentHandler *handler,
+ EMailReplyType reply_type)
{
EMailAttachmentHandlerPrivate *priv;
EShellSettings *shell_settings;
@@ -126,46 +126,24 @@ mail_attachment_handler_reply_all (GtkAction *action,
em_utils_reply_to_message (
priv->shell, CAMEL_MIME_MESSAGE (wrapper),
- NULL, NULL, E_MAIL_REPLY_TO_ALL, style, NULL, NULL);
+ NULL, NULL, reply_type, style, NULL, NULL);
g_list_foreach (selected, (GFunc) g_object_unref, NULL);
g_list_free (selected);
}
static void
+mail_attachment_handler_reply_all (GtkAction *action,
+ EAttachmentHandler *handler)
+{
+ mail_attachment_handler_reply (handler, E_MAIL_REPLY_TO_ALL);
+}
+
+static void
mail_attachment_handler_reply_sender (GtkAction *action,
EAttachmentHandler *handler)
{
- EMailAttachmentHandlerPrivate *priv;
- EShellSettings *shell_settings;
- EAttachment *attachment;
- EAttachmentView *view;
- CamelMimePart *mime_part;
- CamelDataWrapper *wrapper;
- EMailForwardStyle style;
- const gchar *property_name;
- GList *selected;
-
- view = e_attachment_handler_get_view (handler);
- priv = E_MAIL_ATTACHMENT_HANDLER_GET_PRIVATE (handler);
-
- selected = e_attachment_view_get_selected_attachments (view);
- g_return_if_fail (g_list_length (selected) == 1);
-
- attachment = E_ATTACHMENT (selected->data);
- mime_part = e_attachment_get_mime_part (attachment);
- wrapper = camel_medium_get_content (CAMEL_MEDIUM (mime_part));
-
- property_name = "mail-reply-style";
- shell_settings = e_shell_get_shell_settings (priv->shell);
- style = e_shell_settings_get_int (shell_settings, property_name);
-
- em_utils_reply_to_message (
- priv->shell, CAMEL_MIME_MESSAGE (wrapper),
- NULL, NULL, E_MAIL_REPLY_TO_SENDER, style, NULL, NULL);
-
- g_list_foreach (selected, (GFunc) g_object_unref, NULL);
- g_list_free (selected);
+ mail_attachment_handler_reply (handler, E_MAIL_REPLY_TO_SENDER);
}
static GtkActionEntry standard_entries[] = {