aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-02-08 01:50:53 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-02-08 01:50:53 +0800
commitf4885180e033784758b7586c36dcfd46b0cad367 (patch)
tree665ff6c8c828a0545f6d49153dea11272db06dbd /widgets/misc
parenta744dcdb0bfa90d730b173e3ffe818cd81506b9f (diff)
downloadgsoc2013-evolution-f4885180e033784758b7586c36dcfd46b0cad367.tar.gz
gsoc2013-evolution-f4885180e033784758b7586c36dcfd46b0cad367.tar.zst
gsoc2013-evolution-f4885180e033784758b7586c36dcfd46b0cad367.zip
** Fix for bug #249501
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. svn path=/trunk/; revision=34971
Diffstat (limited to 'widgets/misc')
-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;