[gnome-online-accounts/gnome-3-24] webview: Address the loss of SoupSession:accept-language-auto=TRUE

commit 36a52d867c4f169b05b02d66d202888b276245f2
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Aug 8 12:35:20 2017 +0200

    webview: Address the loss of SoupSession:accept-language-auto=TRUE
    With WebKit1, the Accept-Language header could be set for every
    request based on g_get_language_names by using the SoupSession's
    accept-language-auto property. This was lost during the port to
    Since WebKit2 doesn't expose its internal SoupSession, the same
    functionality is now implemented using g_get_language_names and
    Fallout from 81434a02fe638d982afdbe6cd9e5b75ddfdf238f

 src/goabackend/goawebview.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/goabackend/goawebview.c b/src/goabackend/goawebview.c
index c9a315b..7a28e51 100644
--- a/src/goabackend/goawebview.c
+++ b/src/goabackend/goawebview.c
@@ -272,12 +272,15 @@ goa_web_view_constructed (GObject *object)
   GoaWebView *self = GOA_WEB_VIEW (object);
   WebKitCookieManager *cookie_manager;
+  const gchar *const *language_names;
   gchar *jar_dir;
   gchar *jar_file;
   G_OBJECT_CLASS (goa_web_view_parent_class)->constructed (object);
   self->context = webkit_web_context_new ();
+  language_names = g_get_language_names ();
+  webkit_web_context_set_preferred_languages (self->context, language_names);
   g_signal_connect_swapped (self->context,
                             G_CALLBACK (web_view_initialize_web_extensions_cb),

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]