Comment 50 for bug 483443

Revision history for this message
In , Karlt (karlt) wrote :

>+NS_IMETHODIMP
>+nsGIOMimeApp::SetAsDefaultForMimeType(nsACString const& aMimeType)
>+{
>+ char *content_type =
>+ g_content_type_from_mime_type(PromiseFlatCString(aMimeType).get());
>+ if (!content_type)
>+ return NS_ERROR_FAILURE;

>+NS_IMETHODIMP
>+nsGIOService::GetAppForMimeType(const nsACString& aMimeType,
>+ nsIGIOMimeApp** aApp)
>+{
>+ *aApp = nsnull;
>+
>+ char *content_type =
>+ g_content_type_from_mime_type(PromiseFlatCString(aMimeType).get());
>+ if (!content_type)
>+ return NS_ERROR_FAILURE;

>+NS_IMETHODIMP
>+nsGIOService::GetDescriptionForMimeType(const nsACString& aMimeType,
>+ nsACString& aDescription)
>+{
>+ char *content_type =
>+ g_content_type_from_mime_type(PromiseFlatCString(aMimeType).get());
>+ if (!content_type)
>+ return NS_ERROR_FAILURE;
>+

It looks like g_content_type_from_mime_type() is only available from GLib 2.18:
http://library.gnome.org/devel/gio/unstable/ix03.html

Should we require GLib 2.18 for this XPCOM module or is there a reasonable way of doing this that would work with 2.16?