After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 527175 - I miss mime_type > content_type conversion function
I miss mime_type > content_type conversion function
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: Alexander Larsson
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-04-09 16:38 UTC by Milan Crha
Modified: 2008-05-18 02:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed glib patch (2.29 KB, patch)
2008-04-12 18:48 UTC, Milan Crha
needs-work Details | Review
Revised patch (3.12 KB, patch)
2008-05-15 14:16 UTC, Matthew Barnes
committed Details | Review

Description Milan Crha 2008-04-09 16:38:40 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.
Comment 1 Milan Crha 2008-04-12 18:48:24 UTC
Created attachment 109137 [details] [review]
proposed glib patch

for glib;

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. :)
Comment 2 Matthias Clasen 2008-05-15 06:44:37 UTC
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
Comment 3 Matthew Barnes 2008-05-15 14:16:10 UTC
Created attachment 110956 [details] [review]
Revised patch

Since Milan is away...
Comment 4 Matthias Clasen 2008-05-18 02:51:16 UTC
2008-05-17  Matthias Clasen  <mclasen@redhat.com>

        * gcontenttype.h:
        * gcontenttype.c: (g_content_type_from_mime_type):
        New function to create a content type from a mime type. (#527175,
        Milan Crha)