From 5d7c1caffebc5ed44c08774f3d4ab5a5426d4ce9 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 25 Sep 2011 17:03:37 +0000 Subject: Also read mimetype mappings from mimetypes.user svn path=/trunk/netsurf/; revision=12876 --- amiga/dist/NetSurf.guide | 2 +- amiga/filetype.c | 5 +++-- amiga/gui.c | 1 + amiga/pkg/makepackage | 1 + amiga/resources/mimetypes | 7 +++++-- 5 files changed, 11 insertions(+), 5 deletions(-) (limited to 'amiga') diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide index 0abbfb141..1d63bae67 100755 --- a/amiga/dist/NetSurf.guide +++ b/amiga/dist/NetSurf.guide @@ -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= to the tooltypes. diff --git a/amiga/filetype.c b/amiga/filetype.c index 5cb661074..7b6805da7 100644 --- a/amiga/filetype.c +++ b/amiga/filetype.c @@ -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); diff --git a/amiga/gui.c b/amiga/gui.c index b56b2eb06..c5725cd2f 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -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(); diff --git a/amiga/pkg/makepackage b/amiga/pkg/makepackage index 4065f99dc..0c3350219 100755 --- a/amiga/pkg/makepackage +++ b/amiga/pkg/makepackage @@ -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 diff --git a/amiga/resources/mimetypes b/amiga/resources/mimetypes index 966881a44..4068b571f 100644 --- a/amiga/resources/mimetypes +++ b/amiga/resources/mimetypes @@ -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 -- cgit v1.2.3