projects
/
modest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
32320a1
)
* mime-type-guessing for attachments is now case-insensitive and has a default (appli...
author
Arne Zellentin
<arne@kernelconcepts.de>
Wed, 21 Jun 2006 17:16:45 +0000
(17:16 +0000)
committer
Arne Zellentin
<arne@kernelconcepts.de>
Wed, 21 Jun 2006 17:16:45 +0000
(17:16 +0000)
pmo-trunk-r311
src/modest-tny-attachment.c
patch
|
blob
|
history
diff --git
a/src/modest-tny-attachment.c
b/src/modest-tny-attachment.c
index
ecd6b1a
..
99fdacf
100644
(file)
--- a/
src/modest-tny-attachment.c
+++ b/
src/modest-tny-attachment.c
@@
-181,24
+181,26
@@
modest_tny_attachment_get_mime_type (ModestTnyAttachment *self)
}
}
-
void
modest_tny_attachment_guess_mime_type (ModestTnyAttachment *self)
{
ModestTnyAttachmentPrivate *priv;
void
modest_tny_attachment_guess_mime_type (ModestTnyAttachment *self)
{
ModestTnyAttachmentPrivate *priv;
- gchar *suffixes[] = {".jpg", ".gif", ".mp3", NULL};
- gchar *types[] = {"image/jpeg", "image/gif", "audio/mpeg", NULL};
+ gchar *suffixes[] = {".jpg", ".gif", ".png", ".mp3", ".ogg", /* default: */ "", NULL};
+ gchar *types[] = {"image/jpeg", "image/gif", "image/png", "audio/mpeg", "application/ogg", "application/octet-stream", NULL};
+ gchar *low_fn;
gint pos;
priv = MODEST_TNY_ATTACHMENT_GET_PRIVATE(self);
if (!priv->filename)
return;
gint pos;
priv = MODEST_TNY_ATTACHMENT_GET_PRIVATE(self);
if (!priv->filename)
return;
+ low_fn = g_utf8_strdown(priv->filename, -1);
for (pos = 0 ; suffixes[pos] ; pos++) {
for (pos = 0 ; suffixes[pos] ; pos++) {
- if (g_str_has_suffix(priv->filename, suffixes[pos]))
+ if (g_str_has_suffix(low_fn, suffixes[pos]))
break;
}
break;
}
+ g_free(low_fn);
g_free(priv->mime_type);
if (suffixes[pos])
priv->mime_type = g_strdup(types[pos]);
g_free(priv->mime_type);
if (suffixes[pos])
priv->mime_type = g_strdup(types[pos]);