From f3ec28d123a08e6e3b6b5667665dfb4bcb700346 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 8 Nov 2000 13:06:58 +0000 Subject: new function (destroy): use e_msg_composer_clear_inlined_table, destroy 2000-11-08 Radek Doulik * e-msg-composer.c (e_msg_composer_clear_inlined_table): new function (destroy): use e_msg_composer_clear_inlined_table, destroy inlined_images hash table * listener.c (resolve_image_url): don't add inlined images to attachement bar * e-msg-composer.c (add_inlined_images): new function, adds inlined images to multipart (add_inlined_image): helper function, adds one image to multipart (build_message): store HTML messages with inlined images to multipart/related * e-msg-composer-attachment-bar.c (add_from_file): removed content_id arg (e_msg_composer_attachment_bar_attach): likewise * e-msg-composer-attachment.c (e_msg_composer_attachment_new): removed content_id arg svn path=/trunk/; revision=6507 --- composer/e-msg-composer-attachment.c | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'composer/e-msg-composer-attachment.c') diff --git a/composer/e-msg-composer-attachment.c b/composer/e-msg-composer-attachment.c index 537774d109..8fd06f2afa 100644 --- a/composer/e-msg-composer-attachment.c +++ b/composer/e-msg-composer-attachment.c @@ -32,7 +32,6 @@ #include #include #include -#include #include "e-msg-composer-attachment.h" @@ -46,27 +45,6 @@ static guint signals[LAST_SIGNAL] = { 0 }; static GtkObjectClass *parent_class = NULL; -/* Utility functions. */ - -static gchar * -get_mime_type (const gchar *file_name) -{ - GnomeVFSFileInfo info; - GnomeVFSResult result; - - result = gnome_vfs_get_file_info (file_name, &info, - GNOME_VFS_FILE_INFO_GET_MIME_TYPE | - GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (result == GNOME_VFS_OK) { - gchar *type; - - type = g_strdup (gnome_vfs_file_info_get_mime_type (&info)); - gnome_vfs_file_info_unref (&info); - return type; - } else - return NULL; -} - static void changed (EMsgComposerAttachment *attachment) { @@ -165,7 +143,7 @@ e_msg_composer_attachment_get_type (void) * Return value: **/ EMsgComposerAttachment * -e_msg_composer_attachment_new (const gchar *file_name, const gchar *content_id) +e_msg_composer_attachment_new (const gchar *file_name) { EMsgComposerAttachment *new; CamelMimePart *part; @@ -189,7 +167,7 @@ e_msg_composer_attachment_new (const gchar *file_name, const gchar *content_id) wrapper = camel_data_wrapper_new (); camel_data_wrapper_construct_from_stream (wrapper, stream); camel_object_unref (CAMEL_OBJECT (stream)); - mime_type = get_mime_type (file_name); + mime_type = mime_guess_type_from_file_name (file_name); if (mime_type) { camel_data_wrapper_set_mime_type (wrapper, mime_type); g_free (mime_type); @@ -200,14 +178,6 @@ e_msg_composer_attachment_new (const gchar *file_name, const gchar *content_id) camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper); camel_object_unref (CAMEL_OBJECT (wrapper)); - if (content_id) { - gchar *id; - - id = g_strconcat ("<", content_id, ">", NULL); - camel_mime_part_set_content_id (part, id); - g_free (id); - } - camel_mime_part_set_disposition (part, "attachment"); if (strchr (file_name, '/')) camel_mime_part_set_filename (part, strrchr (file_name, '/') + 1); @@ -281,7 +251,7 @@ update_mime_type (DialogData *data) return; file_name = e_utf8_gtk_entry_get_text (data->file_name_entry); - mime_type = get_mime_type (file_name); + mime_type = mime_guess_type_from_file_name (file_name); g_free (file_name); e_utf8_gtk_entry_set_text (data->mime_type_entry, mime_type); -- cgit v1.2.3