[webkit-gtk] possible solutions for local files on win32

Phil Longstaff plongstaff at rogers.com
Tue Dec 22 04:37:42 PST 2009


Since both g_content_type_get_mime_type() and
g_file_info_get_content_type() are glib functions which are on linux as
well, do you need the #if, or can your substitution work on all
platforms?

Phil

On Tue, 2009-11-03 at 01:20 +0100, Josip wrote:
> Hi again!
> Found some possible solutions for those who have problems with local 
> files on win32 due to mime-share-info misconfiguration or missing 
> dependencies etc.
> As g_file_info_get_content_type() returns just file extension (like 
> ".html") and win32 use those to determine mime type can we use 
> g_content_type_get_mime_type() on them like in attachment.
> It works for me, load html files (with right encoding), images etc...
> Or should we rather check for return type on runtime and use those if 
> returned type is file extension (in case some really have full working 
> version)?
> 
> plain text document attachment (setMimeType.diff)
> --- webkit-1.1.15.3/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2009-10-05 22:35:14.000000000 +0200
> +++ webkit-1.1.15.3/WebCore/platform/network/soup/ResourceHandleSoup.cpp	2009-11-03 00:42:41.358880082 +0100
> @@ -835,7 +835,11 @@
>          return;
>      }
>  
> +    #if PLATFORM(WIN_OS)
> +    response.setMimeType(g_content_type_get_mime_type(g_file_info_get_content_type(info)));
> +    #else
>      response.setMimeType(g_file_info_get_content_type(info));
> +    #endif
>      response.setExpectedContentLength(g_file_info_get_size(info));
>  
>      GTimeVal tv;
> _______________________________________________
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk




More information about the webkit-gtk mailing list