diff options
author | Dan Vrátil <dvratil@redhat.com> | 2012-04-23 14:40:20 +0800 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2012-04-23 14:40:20 +0800 |
commit | d571c56260d30a00a03112b8bdfff463d4a24b81 (patch) | |
tree | 28905f8b19ac50d999ff3ed9cb6ea7f547628a7d /widgets/misc | |
parent | 95746c8e3a9c341fac7beae7bc279d6379beb7e4 (diff) | |
download | gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.tar.gz gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.tar.zst gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.zip |
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.
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/e-web-view.c | 33 | ||||
-rw-r--r-- | widgets/misc/e-web-view.h | 5 |
2 files changed, 37 insertions, 1 deletions
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 <libevolution-utils/e-alert-dialog.h> #include <libevolution-utils/e-alert-sink.h> #include <e-util/e-plugin-ui.h> +#include <e-util/e-file-request.h> -#include <mail/e-mail-request.h> +#define LIBSOUP_USE_UNSTABLE_REQUEST_API +#include <libsoup/soup.h> +#include <libsoup/soup-requester.h> #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); + } +} + diff --git a/widgets/misc/e-web-view.h b/widgets/misc/e-web-view.h index 02eb9ecf66..5aab752b50 100644 --- a/widgets/misc/e-web-view.h +++ b/widgets/misc/e-web-view.h @@ -230,6 +230,11 @@ void e_web_view_update_fonts (EWebView *web_view); WebKitWebSettings * e_web_view_get_default_settings (void); +void e_web_view_install_request_handler + (EWebView *web_view, + GType handler_type); + + G_END_DECLS #endif /* E_WEB_VIEW_H */ |