diff options
Diffstat (limited to 'composer/e-msg-composer-attachment.c')
-rw-r--r-- | composer/e-msg-composer-attachment.c | 36 |
1 files changed, 3 insertions, 33 deletions
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 <gnome.h> #include <camel/camel.h> #include <gal/widgets/e-unicode.h> -#include <libgnomevfs/gnome-vfs.h> #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); |