diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-07-29 11:04:20 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-08-04 09:42:01 +0000 |
commit | 2a56ec7ce4713711b55bb1dfc86a4320d943f606 (patch) | |
tree | aa7edd2223e443384e157aaa367795aaec4e8a37 /src/webengine/api/qquickwebengineprofile.cpp | |
parent | e11cd75ff506e8dcbfc990d70baeec821f1f0563 (diff) | |
download | qtwebengine-2a56ec7ce4713711b55bb1dfc86a4320d943f606.tar.gz |
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 <kai.koehne@theqtcompany.com>
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/webengine/api/qquickwebengineprofile.cpp')
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 75ac6bb62..38b042fff 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -399,6 +399,28 @@ void QQuickWebEngineProfile::setHttpCacheMaximumSize(int maximumSize) emit httpCacheMaximumSizeChanged(); } +/*! + \qmlproperty QString WebEngineProfile::httpAcceptLanguage + + The value of the Accept-Language HTTP request-header field. + + \since QtWebEngine 1.2 +*/ +QString QQuickWebEngineProfile::httpAcceptLanguage() const +{ + Q_D(const QQuickWebEngineProfile); + return d->browserContext()->httpAcceptLanguage(); +} + +void QQuickWebEngineProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage) +{ + Q_D(QQuickWebEngineProfile); + if (d->browserContext()->httpAcceptLanguage() == httpAcceptLanguage) + return; + d->browserContext()->setHttpAcceptLanguage(httpAcceptLanguage); + emit httpAcceptLanguageChanged(); +} + QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile() { static QQuickWebEngineProfile *profile = new QQuickWebEngineProfile( |