aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog9
-rw-r--r--composer/e-msg-composer.c34
-rw-r--r--composer/e-msg-composer.h1
3 files changed, 11 insertions, 33 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 6fa47caa1f..bd6c1a3037 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,12 @@
+2008-04-17 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #526739
+
+ * e-msg-composer.h: (e_msg_composer_guess_mime_type):
+ * e-msg-composer.c: (e_msg_composer_guess_mime_type), (handle_uri),
+ (e_msg_composer_add_inline_image_from_file):
+ Use shared e_util_guess_mime_type instead of its own.
+
2008-04-14 Matthew Barnes <mbarnes@redhat.com>
* e-composer-autosave.c (e_composer_autosave_unregister):
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index ac9f452f07..276db10ce8 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -62,7 +62,6 @@
#include <gconf/gconf-client.h>
#include <libgnome/gnome-url.h>
-#include <libgnomevfs/gnome-vfs.h>
#include <glade/glade.h>
@@ -3948,7 +3947,7 @@ handle_uri (EMsgComposer *composer,
return;
if (!g_ascii_strcasecmp (url->protocol, "file")) {
- type = e_msg_composer_guess_mime_type (uri);
+ type = e_util_guess_mime_type (uri + strlen ("file://"));
if (!type)
return;
@@ -4180,7 +4179,7 @@ e_msg_composer_add_inline_image_from_file (EMsgComposer *composer,
camel_data_wrapper_construct_from_stream (wrapper, stream);
camel_object_unref (CAMEL_OBJECT (stream));
- mime_type = e_msg_composer_guess_mime_type (dec_file_name);
+ mime_type = e_util_guess_mime_type (dec_file_name);
if (mime_type == NULL)
mime_type = g_strdup ("application/octet-stream");
camel_data_wrapper_set_mime_type (wrapper, mime_type);
@@ -4533,35 +4532,6 @@ e_msg_composer_get_reply_to (EMsgComposer *composer)
}
/**
- * e_msg_composer_guess_mime_type:
- * @filename: filename
- *
- * Returns the guessed mime type of the file given by @filename.
- **/
-gchar *
-e_msg_composer_guess_mime_type (const gchar *filename)
-{
- GnomeVFSFileInfo *info;
- GnomeVFSResult result;
- gchar *type = NULL;
-
- g_return_val_if_fail (filename != NULL, NULL);
-
- info = gnome_vfs_file_info_new ();
- result = gnome_vfs_get_file_info (
- filename, info,
- GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
- GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE |
- GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
- if (result == GNOME_VFS_OK)
- type = g_strdup (gnome_vfs_file_info_get_mime_type (info));
-
- gnome_vfs_file_info_unref (info);
-
- return type;
-}
-
-/**
* e_msg_composer_get_raw_message_text:
*
* Returns the text/plain of the message from composer
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index 251c170426..54dc906171 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -125,7 +125,6 @@ CamelInternetAddress *
void e_msg_composer_clear_inlined_table
(EMsgComposer *composer);
-gchar * e_msg_composer_guess_mime_type (const gchar *filename);
void e_msg_composer_set_enable_autosave
(EMsgComposer *composer,
gboolean enabled);