diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-02-04 03:10:40 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-02-04 03:10:40 +0800 |
commit | 5b0dc680a2f46999015b4c16d7c2990253501fdc (patch) | |
tree | bdd6d1bcbc539c5e7814a88421e08d2c717acf1d /composer | |
parent | d2f0410b09bd00e167b5de81977d96e48d044a2e (diff) | |
download | gsoc2013-evolution-5b0dc680a2f46999015b4c16d7c2990253501fdc.tar gsoc2013-evolution-5b0dc680a2f46999015b4c16d7c2990253501fdc.tar.gz gsoc2013-evolution-5b0dc680a2f46999015b4c16d7c2990253501fdc.tar.bz2 gsoc2013-evolution-5b0dc680a2f46999015b4c16d7c2990253501fdc.tar.lz gsoc2013-evolution-5b0dc680a2f46999015b4c16d7c2990253501fdc.tar.xz gsoc2013-evolution-5b0dc680a2f46999015b4c16d7c2990253501fdc.tar.zst gsoc2013-evolution-5b0dc680a2f46999015b4c16d7c2990253501fdc.zip |
Just use gnome_vfs_get_mime_type_from_name().
2003-02-03 Jeffrey Stedfast <fejj@ximian.com>
* e-msg-composer-attachment.c: Just use
gnome_vfs_get_mime_type_from_name().
svn path=/trunk/; revision=19712
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 5 | ||||
-rw-r--r-- | composer/e-msg-composer-attachment.c | 24 |
2 files changed, 8 insertions, 21 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index e40e83e2a0..b845527906 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,8 @@ +2003-02-03 Jeffrey Stedfast <fejj@ximian.com> + + * e-msg-composer-attachment.c: Just use + gnome_vfs_get_mime_type_from_name(). + 2003-02-01 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-attachment.c (update_mime_type): Give diff --git a/composer/e-msg-composer-attachment.c b/composer/e-msg-composer-attachment.c index 45b8a86c8e..2cd3315771 100644 --- a/composer/e-msg-composer-attachment.c +++ b/composer/e-msg-composer-attachment.c @@ -304,35 +304,17 @@ destroy_dialog_data (DialogData *data) static void update_mime_type (DialogData *data) { - const char *filename, *tmpdir; - char *mime_type, *path, *uri; + const char *filename, *mime_type; if (!data->attachment->guessed_type) return; filename = gtk_entry_get_text (data->file_name_entry); if (filename) { - /* gnome_vfs_get_mime_type() might try to access the - * file and read it to 'sniff' the mime-type if it is - * there (and gnome-vfs can't determine the mime-type - * based on filename extension?), so we need to make - * sure the file doesn't exist yet we want to keep the - * filename intact so that gnome-vfs can try and - * determine the mime-type by the filename. This is - * kinda nasty. - */ + mime_type = gnome_vfs_get_mime_type_from_name (filename); - tmpdir = e_mkdtemp ("mime-identify-XXXXXX"); - path = g_strdup_printf ("%s/%s", tmpdir, filename); - uri = gnome_vfs_get_uri_from_local_path (path); - mime_type = gnome_vfs_get_mime_type (uri); - g_free (path); - g_free (uri); - - if (mime_type) { + if ((mime_type = gnome_vfs_get_mime_type_from_name (filename)) gtk_entry_set_text (data->mime_type_entry, mime_type); - g_free (mime_type); - } } } |