From d571c56260d30a00a03112b8bdfff463d4a24b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Mon, 23 Apr 2012 08:40:20 +0200 Subject: Bug #674272 - Contacts preview differs with mailer running and not This splits the giant EMailRequest to individual EFileRequest, EStockRequest, EHTTPRequest and EMailRequest, making the first two available globally from e-utils, the othe two are loaded only with mailer, since no other component uses them. --- widgets/misc/e-web-view.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'widgets/misc/e-web-view.c') diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 0eab91a806..c5b65337fb 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -37,8 +37,11 @@ #include #include #include +#include -#include +#define LIBSOUP_USE_UNSTABLE_REQUEST_API +#include +#include #include "e-popup-action.h" #include "e-selectable.h" @@ -1712,6 +1715,8 @@ e_web_view_init (EWebView *web_view) e_web_view_set_settings (web_view, web_settings); g_object_unref (web_settings); + e_web_view_install_request_handler (web_view, E_TYPE_FILE_REQUEST); + settings = g_settings_new ("org.gnome.desktop.interface"); g_signal_connect_swapped ( settings, "changed::font-name", @@ -3001,3 +3006,29 @@ e_web_view_update_fonts(EWebView *web_view) pango_font_description_free (ms); pango_font_description_free (vw); } + +void +e_web_view_install_request_handler (EWebView *web_view, + GType handler_type) +{ + SoupSession *session; + SoupSessionFeature *feature; + gboolean new; + + session = webkit_get_default_session (); + + feature = soup_session_get_feature (session, SOUP_TYPE_REQUESTER); + new = FALSE; + if (feature == NULL) { + feature = SOUP_SESSION_FEATURE (soup_requester_new ()); + soup_session_add_feature (session, feature); + new = TRUE; + } + + soup_session_feature_add_feature (feature, handler_type); + + if (new) { + g_object_unref (feature); + } +} + -- cgit v1.2.3