summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amiga/drag.c2
-rw-r--r--amiga/filetype.c23
-rw-r--r--amiga/filetype.h2
3 files changed, 24 insertions, 3 deletions
diff --git a/amiga/drag.c b/amiga/drag.c
index 8f5625bcf..0a0bae356 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -66,7 +66,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
{
case GUI_SAVE_OBJECT_ORIG: // object
case GUI_SAVE_SOURCE:
- filetype = ami_content_type_to_file_type(content_get_type(c));
+ filetype = ami_mime_content_to_filetype(c);
break;
case GUI_SAVE_COMPLETE:
filetype = "drawer";
diff --git a/amiga/filetype.c b/amiga/filetype.c
index e99a0fb33..ceff1c8a4 100644
--- a/amiga/filetype.c
+++ b/amiga/filetype.c
@@ -148,8 +148,6 @@ char *fetch_mimetype(const char *ro_path)
const char *ami_content_type_to_file_type(content_type type)
{
- /* TODO: Can we pass MIME types to this function instead? */
-
switch(type)
{
case CONTENT_HTML:
@@ -164,6 +162,10 @@ const char *ami_content_type_to_file_type(content_type type)
return "css";
break;
+ case CONTENT_IMAGE:
+ return "picture";
+ break;
+
default:
return "project";
break;
@@ -252,6 +254,7 @@ nserror ami_mime_init(const char *mimefile)
void ami_mime_free(void)
{
+ ami_mime_dump();
FreeObjList(ami_mime_list);
}
@@ -508,6 +511,22 @@ struct Node *ami_mime_to_filetype(lwc_string *mimetype,
}
}
+const char *ami_mime_content_to_filetype(struct hlcache_handle *c)
+{
+ struct Node *node;
+ lwc_string *filetype;
+ lwc_string *mimetype;
+
+ mimetype = content_get_mime_type(c);
+
+ node = ami_mime_to_filetype(mimetype, &filetype, NULL);
+
+ if(node && (filetype != NULL))
+ return lwc_string_data(filetype);
+ else
+ return ami_content_type_to_file_type(content_get_type(c));
+}
+
/**
* Return all MIME types containing a plugincmd
*
diff --git a/amiga/filetype.h b/amiga/filetype.h
index 03302bf57..851dddf36 100644
--- a/amiga/filetype.h
+++ b/amiga/filetype.h
@@ -37,7 +37,9 @@ struct Node *ami_mime_from_datatype(struct DataType *dt,
struct Node *ami_mime_to_filetype(lwc_string *mimetype,
lwc_string **filetype, struct Node *start_node);
+const char *ami_mime_content_to_filetype(struct hlcache_handle *c);
lwc_string *ami_mime_content_to_cmd(struct hlcache_handle *c);
+
struct Node *ami_mime_has_cmd(lwc_string **mimetype, struct Node *start_node);
bool ami_mime_compare(struct hlcache_handle *c, const char *type);