aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-attachment.c15
2 files changed, 23 insertions, 0 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 3e530c7cd2..4ff9f1d11c 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,11 @@
+2008-02-07 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #249501
+
+ * e-attachment.c: (attachment_guess_mime_type):
+ gnome_vfs_get_file_info expects URI,
+ thus if file_name contains '%' it failed.
+
2007-01-25 Johnny Jacob <jjohnny@novell.com>
* e-filter-bar.h : Added a cameloperation cancel field for vfolder
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 911672098d..4bbaebd3ab 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -235,6 +235,21 @@ attachment_guess_mime_type (const char *file_name)
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) {
+ CamelURL *url;
+ char *uri;
+
+ url = camel_url_new ("file://", NULL);
+ camel_url_set_path (url, file_name);
+ uri = camel_url_to_string (url, 0);
+ camel_url_free (url);
+
+ result = gnome_vfs_get_file_info (uri, info, GNOME_VFS_FILE_INFO_GET_MIME_TYPE | GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE | GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+
+ g_free (uri);
+ }
+
if (result == GNOME_VFS_OK) {
gchar *content = NULL;