From 143ba4162a04d8a623245c8965b7cce54326cd0b Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 27 Jan 2003 18:05:56 +0000 Subject: Fixed a #warning by converting the filename into a uri before passing it 2003-01-27 Jeffrey Stedfast * e-msg-composer-attachment.c (update_mime_type): Fixed a #warning by converting the filename into a uri before passing it into gnome_vfs_get_mime_type() since that function really needs a uri. 2003-01-22 Jeffrey Stedfast * e-msg-composer-hdrs.c (init): Get the list of accounts here and ref the account-list. (destroy): Unref the accounts list here. (create_from_optionmenu): Connect to the added/changed/removed account-list signals here. (account_added_cb): New callback function that adds the newly added account to the from-dropdown menu. (account_changed_cb): New callback that changes the label for the account that got changed in the dropdown menu. (account_removed_cb): Removes the account from the from dropdown menu. svn path=/trunk/; revision=19654 --- composer/e-msg-composer-attachment.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 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 4e97e71a6e..64daad1164 100644 --- a/composer/e-msg-composer-attachment.c +++ b/composer/e-msg-composer-attachment.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "e-msg-composer.h" @@ -301,15 +302,17 @@ destroy_dialog_data (DialogData *data) static void update_mime_type (DialogData *data) { - const char *file_name; - char *mime_type; + const char *filename; + char *mime_type, *uri; if (!data->attachment->guessed_type) return; - file_name = gtk_entry_get_text (data->file_name_entry); -#warning "do we need to create file uri for gnome-vfs-get-mime-type" - mime_type = gnome_vfs_get_mime_type (file_name); + filename = gtk_entry_get_text (data->file_name_entry); + + uri = gnome_vfs_get_uri_from_local_path (filename); + mime_type = gnome_vfs_get_mime_type (uri); + g_free (uri); if (mime_type) { gtk_entry_set_text (data->mime_type_entry, mime_type); -- cgit v1.2.3