aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-09-06 07:12:27 +0800
committerDan Winship <danw@src.gnome.org>2000-09-06 07:12:27 +0800
commitd9da6499c0dbb37c30e940bbb2100132f7ddf489 (patch)
tree011237b6edd7490919f3fb6f863a443076b15474 /mail
parent1bafa31bc2b7f1919b12240a4bb27077d0e0064f (diff)
downloadgsoc2013-evolution-d9da6499c0dbb37c30e940bbb2100132f7ddf489.tar.gz
gsoc2013-evolution-d9da6499c0dbb37c30e940bbb2100132f7ddf489.tar.zst
gsoc2013-evolution-d9da6499c0dbb37c30e940bbb2100132f7ddf489.zip
camel_mime_part_get_filename now deals with both Content-Disposition and
* mail-display.c (make_safe_filename): * mail-format.c (handle_mystery): * mail-identify.c (mail_identify_mime_part): camel_mime_part_get_filename now deals with both Content-Disposition and Content-Type. svn path=/trunk/; revision=5215
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/mail-display.c7
-rw-r--r--mail/mail-format.c6
-rw-r--r--mail/mail-identify.c12
4 files changed, 10 insertions, 23 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5b09940faa..9098746446 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2000-09-05 Dan Winship <danw@helixcode.com>
+
+ * mail-display.c (make_safe_filename):
+ * mail-format.c (handle_mystery):
+ * mail-identify.c (mail_identify_mime_part):
+ camel_mime_part_get_filename now deals with both
+ Content-Disposition and Content-Type.
+
2000-09-05 Peter Williams <peterw@helixcode.com>
* mail-ops.c (cleanup_load_folder): Check for NULL folder.
diff --git a/mail/mail-display.c b/mail/mail-display.c
index d8b49c2128..960c97d18f 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -94,15 +94,10 @@ write_data_to_file (CamelMimePart *part, const char *name, gboolean unique)
static char *
make_safe_filename (const char *prefix, CamelMimePart *part)
{
- GMimeContentField *type;
const char *name = NULL;
char *safe, *p;
- type = camel_mime_part_get_content_type (part);
- if (type)
- name = gmime_content_field_get_parameter (type, "name");
- if (!name)
- name = camel_mime_part_get_filename (part);
+ name = camel_mime_part_get_filename (part);
if (!name)
name = "attachment";
diff --git a/mail/mail-format.c b/mail/mail-format.c
index fc0fd20f87..c8cff1d857 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -1243,7 +1243,6 @@ handle_mystery (CamelMimePart *part, MailDisplay *md,
{
const char *info;
char *htmlinfo;
- GMimeContentField *content_type;
mail_html_write (md->html, md->stream, "<table><tr><td>");
@@ -1276,10 +1275,7 @@ handle_mystery (CamelMimePart *part, MailDisplay *md,
}
/* Write the name, if we have it. */
- content_type = camel_mime_part_get_content_type (part);
- info = gmime_content_field_get_parameter (content_type, "name");
- if (!info)
- info = camel_mime_part_get_filename (part);
+ info = camel_mime_part_get_filename (part);
if (info) {
htmlinfo = e_text_to_html (info, 0);
mail_html_write (md->html, md->stream, "Name: %s<br>",
diff --git a/mail/mail-identify.c b/mail/mail-identify.c
index e8d82cb8f5..3f86ea361c 100644
--- a/mail/mail-identify.c
+++ b/mail/mail-identify.c
@@ -42,27 +42,15 @@
char *
mail_identify_mime_part (CamelMimePart *part)
{
- GMimeContentField *content_type;
const char *filename, *type;
GnomeVFSMimeSniffBuffer *sniffer;
CamelStream *memstream;
CamelDataWrapper *data;
GByteArray *ba;
- content_type = camel_mime_part_get_content_type (part);
-
-
/* Try identifying based on name in Content-Type or
* filename in Content-Disposition.
*/
- filename = gmime_content_field_get_parameter (content_type, "name");
- if (filename) {
- type = gnome_vfs_mime_type_from_name_or_default (filename,
- NULL);
- if (type)
- return g_strdup (type);
- }
-
filename = camel_mime_part_get_filename (part);
if (filename) {
type = gnome_vfs_mime_type_from_name_or_default (filename,