Also read mimetype mappings from mimetypes.user

svn path=/trunk/netsurf/; revision=12876
This commit is contained in:
Chris Young 2011-09-25 17:03:37 +00:00
parent 4573560c61
commit 5d7c1caffe
5 changed files with 11 additions and 5 deletions

View File

@ -203,7 +203,7 @@ Will look something like the following within the menu:
@node mimetypes "Local MIME Types"
NetSurf determines the MIME types of local files primarily by checking the icon of the file. If the icon is not found it will check the default icon for the file type.
It looks for a tooltype MIMETYPE and, if found, will use the contents as the filetype of the file. If not found it makes a guess at the MIME type using datatypes.library, however this will not be very accurate.
It looks for a tooltype MIMETYPE and, if found, will use the contents as the filetype of the file. If not found it will use datatypes.library and do a reverse lookup based on the contents of Resources/mimetypes[.user]
The Installer script will set the MIMETYPE tooltype on basic relevant default filetype icons. If you get problems:
* If the file has a real icon, add MIMETYPE=<MIME type of file> to the tooltypes.

View File

@ -34,7 +34,7 @@
* filetype -- determine the MIME type of a local file
*/
struct MinList *ami_mime_list;
struct MinList *ami_mime_list = NULL;
struct ami_mime_entry
{
@ -186,7 +186,8 @@ nserror ami_mime_init(const char *mimefile)
struct nsObject *node;
struct ami_mime_entry *mimeentry;
ami_mime_list = NewObjList();
if(ami_mime_list == NULL)
ami_mime_list = NewObjList();
rargs = AllocDosObjectTags(DOS_RDARGS,TAG_DONE);

View File

@ -760,6 +760,7 @@ int main(int argc, char** argv)
die("Cannot open Messages file");
ami_mime_init("PROGDIR:Resources/mimetypes");
ami_mime_init("PROGDIR:Resources/mimetypes.user");
ami_schedule_open_timer();
ami_schedule_create();

View File

@ -10,6 +10,7 @@ delete ram:netsurf/resources/#?hotlist#?
delete ram:netsurf/resources/cookies
delete ram:netsurf/resources/urls
delete ram:netsurf/resources/options
delete ram:netsurf/resources/#?.user
copy resources/Pointers/~(.svn) ram:NetSurf/Resources/Pointers
copy (COPYING|ChangeLog) ram:NetSurf/
copy NetSurf ram:NetSurf/NetSurf

View File

@ -15,7 +15,10 @@
; assigned a MIME type constructed from the DataTypes superclass
; and a lowercase version of the full format name (eg. ILBM becomes
; image/ilbm)
;
; Please DO NOT edit this file, any changes will be overwritten on
; reinstall/upgrade. Instead create a file called mimetypes.user
; with any additions, and place it in the same directory as mimetypes.
;
; Image types
@ -48,7 +51,7 @@ application/ico DT=ICO TYPE=ico
application/x-ico DT=ICO TYPE=ico
; .info
image/x-amiga-icon DT=INFO
image/x-amiga-icon DT="AmigaOS Icon"
; JNG
image/jng DT=JNG TYPE=jng