From 983671c8cbe81491d76082b09088d215f4d3309d Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 15 Oct 2015 15:51:23 +0200 Subject: [PATCH] Shibboleth: Add our base user agent to WebKit For #3913 --- src/gui/creds/shibboleth/shibbolethwebview.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/creds/shibboleth/shibbolethwebview.cpp b/src/gui/creds/shibboleth/shibbolethwebview.cpp index 41567deda..601bddf20 100644 --- a/src/gui/creds/shibboleth/shibbolethwebview.cpp +++ b/src/gui/creds/shibboleth/shibbolethwebview.cpp @@ -36,6 +36,14 @@ namespace { namespace OCC { +class UserAgentWebPage : public QWebPage { + public: + UserAgentWebPage(QObject *parent) : QWebPage(parent) {} + QString userAgentForUrl(const QUrl &url ) const { + return QWebPage::userAgentForUrl(url) + " " + Utility::userAgentString(); + } +}; + ShibbolethWebView::ShibbolethWebView(AccountPtr account, QWidget* parent) : QWebView(parent) , _account(account) @@ -46,7 +54,7 @@ ShibbolethWebView::ShibbolethWebView(AccountPtr account, QWidget* parent) setWindowFlags(Qt::Dialog); setAttribute(Qt::WA_DeleteOnClose); - QWebPage* page = new QWebPage(this); + QWebPage* page = new UserAgentWebPage(this); connect(page, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); connect(page, SIGNAL(loadFinished(bool)), -- 2.30.2