aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c128
1 files changed, 0 insertions, 128 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 5122aa2247..ecf07c50f9 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -271,128 +271,6 @@ exit:
}
static void
-attachment_load_finish (EAttachment *attachment,
- GAsyncResult *result,
- GFile *file)
-{
- EShell *shell;
- GtkWindow *parent;
-
- e_attachment_load_finish (attachment, result, NULL);
-
- shell = e_shell_get_default ();
- parent = e_shell_get_active_window (shell);
-
- e_attachment_save_async (
- attachment, file, (GAsyncReadyCallback)
- e_attachment_save_handle_error, parent);
-
- g_object_unref (file);
-}
-
-static void
-action_mail_image_save_cb (GtkAction *action,
- EMailReader *reader)
-{
- EShell *shell;
- EMailBackend *backend;
- EMailDisplay *display;
- EWebView *web_view;
- EMailPartList *parts;
- const gchar *image_src;
- CamelMimePart *part;
- CamelMimeMessage *message;
- EAttachment *attachment;
- GFile *file;
-
- backend = e_mail_reader_get_backend (reader);
- shell = e_shell_backend_get_shell (E_SHELL_BACKEND (backend));
-
- display = e_mail_reader_get_mail_display (reader);
- if (display == NULL)
- return;
-
- web_view = E_WEB_VIEW (display);
- image_src = e_web_view_get_cursor_image_src (web_view);
- if (image_src == NULL)
- return;
-
- parts = e_mail_display_get_part_list (display);
- g_return_if_fail (parts != NULL);
-
- message = e_mail_part_list_get_message (parts);
- g_return_if_fail (message != NULL);
-
- if (g_str_has_prefix (image_src, "cid:")) {
- part = camel_mime_message_get_part_by_content_id (
- message, image_src + 4);
- g_return_if_fail (part != NULL);
-
- g_object_ref (part);
- } else {
- CamelStream *image_stream;
- CamelDataWrapper *dw;
- CamelDataCache *cache;
- const gchar *filename;
- const gchar *user_cache_dir;
-
- /* Open cache and find the file there */
- user_cache_dir = e_get_user_cache_dir ();
- cache = camel_data_cache_new (user_cache_dir, NULL);
- image_stream = camel_data_cache_get (
- cache, "http", image_src, NULL);
- if (image_stream == NULL) {
- g_object_unref (cache);
- return;
- }
-
- filename = strrchr (image_src, '/');
- if (filename != NULL) {
- if (strchr (filename, '?') == NULL)
- filename++;
- else
- filename = NULL;
- }
-
- part = camel_mime_part_new ();
- if (filename != NULL)
- camel_mime_part_set_filename (part, filename);
-
- dw = camel_data_wrapper_new ();
- camel_data_wrapper_set_mime_type (
- dw, "application/octet-stream");
- camel_data_wrapper_construct_from_stream_sync (
- dw, image_stream, NULL, NULL);
- camel_medium_set_content (CAMEL_MEDIUM (part), dw);
- g_object_unref (dw);
-
- camel_mime_part_set_encoding (
- part, CAMEL_TRANSFER_ENCODING_BASE64);
-
- g_object_unref (image_stream);
- g_object_unref (cache);
- }
-
- file = e_shell_run_save_dialog (
- shell, _("Save Image"),
- camel_mime_part_get_filename (part),
- NULL, NULL, NULL);
- if (file == NULL) {
- g_object_unref (part);
- return;
- }
-
- attachment = e_attachment_new ();
- e_attachment_set_mime_part (attachment, part);
-
- e_attachment_load_async (
- attachment, (GAsyncReadyCallback)
- attachment_load_finish, file);
-
- g_object_unref (part);
-}
-
-static void
action_mail_charset_cb (GtkRadioAction *action,
GtkRadioAction *current,
EMailReader *reader)
@@ -3957,12 +3835,6 @@ e_mail_reader_init (EMailReader *reader,
action, "activate",
G_CALLBACK (action_search_folder_sender_cb), reader);
- action_name = "image-save";
- action = e_mail_display_get_action (display, action_name);
- g_signal_connect (
- action, "activate",
- G_CALLBACK (action_mail_image_save_cb), reader);
-
#ifndef G_OS_WIN32
/* Lockdown integration. */