GNOME Bugzilla – Bug 527175
I miss mime_type > content_type conversion function
Last modified: 2008-05-18 02:51:16 UTC
I'm not sure how many people miss a conversion function from mime_type to content_type, but I would like to have one, really. I miss it very much when porting from gnome-vfs to gio/gvfs, because gnome-vfs was all about mime_types.
Because Win32 uses extensions, then passing a mime_type to g_app_info_get_all_for_type (for example) will not work. It will hopefully work on unix/linux systems, though.
Created attachment 109137 [details] [review]
proposed glib patch
I wasn't able to check the Win32 version of the new g_content_type_from_mime_type function, but it's so simple then it should work. :)
The api addition makes sense to me.
The patch could use g_strconcat instead of g_strdup_printf, and the api docs need a "Since" tag (and the new symbol needs to be added to gio/gio.symbols and docs/reference/gio/gio-sections.txt
Created attachment 110956 [details] [review]
Since Milan is away...
2008-05-17 Matthias Clasen <firstname.lastname@example.org>
* gcontenttype.c: (g_content_type_from_mime_type):
New function to create a content type from a mime type. (#527175,