add a way to get the (primary) extension for a content type (MIME type)
Submitted by Sascha Silbe
Link to original bug (#681366)
Description
gio provides a way to guess content types (MIME types) based on file extensions (g_content_type_guess()), but not the other way round. The latter case is important for modern tools that operate based on MIME types, but need to interface with other tools that still use the file name extension to determine the file type.
Sugar currently ships [1] custom code that parses ~/.local/share/mime/globs directly to achieve this task.
[1] http://git.sugarlabs.org/sugar-base/mainline/blobs/master/src/sugar/mime.py#line144 (get_primary_extension())