From 2a56ec7ce4713711b55bb1dfc86a4320d943f606 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 29 Jul 2015 11:04:20 +0200 Subject: add API to set the Accept-Language HTTP request-header field Add methods to set the Accept-Language field in QWebEngineProfile and QQuickWebEngineProfile. Task-number: QTBUG-47412 Change-Id: Ifa376bb3551fdc1fb3d68279d734b7f7735782fc Reviewed-by: Kai Koehne Reviewed-by: Andras Becsi --- src/webenginewidgets/api/qwebengineprofile.cpp | 22 ++++++++++++++++++++++ src/webenginewidgets/api/qwebengineprofile.h | 3 +++ 2 files changed, 25 insertions(+) (limited to 'src/webenginewidgets') diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index b73355ac2..29010b0dd 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -354,6 +354,28 @@ void QWebEngineProfile::setHttpCacheType(QWebEngineProfile::HttpCacheType httpCa d->browserContext()->setHttpCacheType(BrowserContextAdapter::HttpCacheType(httpCacheType)); } +/*! + Sets the value of the Accept-Language HTTP request-header field. + + \since 5.6 + */ +void QWebEngineProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage) +{ + Q_D(QWebEngineProfile); + d->browserContext()->setHttpAcceptLanguage(httpAcceptLanguage); +} + +/*! + Returns the value of the Accept-Language HTTP request-header field. + + \since 5.6 + */ +QString QWebEngineProfile::httpAcceptLanguage() const +{ + Q_D(const QWebEngineProfile); + return d->browserContext()->httpAcceptLanguage(); +} + /*! Returns the current policy for persistent cookies. diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h index c90ea01e5..09160fecb 100644 --- a/src/webenginewidgets/api/qwebengineprofile.h +++ b/src/webenginewidgets/api/qwebengineprofile.h @@ -89,6 +89,9 @@ public: HttpCacheType httpCacheType() const; void setHttpCacheType(QWebEngineProfile::HttpCacheType); + void setHttpAcceptLanguage(const QString &httpAcceptLanguage); + QString httpAcceptLanguage() const; + PersistentCookiesPolicy persistentCookiesPolicy() const; void setPersistentCookiesPolicy(QWebEngineProfile::PersistentCookiesPolicy); -- cgit v1.2.3