From abba8dd0f2d94e67e211aaab7c91d63c07e8497c Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Date: Tue, 1 Jul 2014 16:39:55 +0200
Subject: [PATCH] Don't use QAuthenticator private API

QAuthenticator::setRealm has been added to QtNetwork 5.4.

Change-Id: I7eb503956d72a96e1f5030896cdf9adb7d4030cb
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
---
 src/webenginewidgets/api/qwebenginepage.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 430fa30a2..fd1f54834 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -33,6 +33,7 @@
 
 #include <QAction>
 #include <QApplication>
+#include <QAuthenticator>
 #include <QClipboard>
 #include <QFileDialog>
 #include <QIcon>
@@ -42,7 +43,6 @@
 #include <QMessageBox>
 #include <QStandardPaths>
 #include <QUrl>
-#include <private/qauthenticator_p.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -313,9 +313,7 @@ void QWebEnginePagePrivate::authenticationRequired(const QUrl &requestUrl, const
 {
     Q_Q(QWebEnginePage);
     QAuthenticator networkAuth;
-    // Detach to trigger the creation of its QAuthenticatorPrivate.
-    networkAuth.detach();
-    QAuthenticatorPrivate::getPrivate(networkAuth)->realm = realm;
+    networkAuth.setRealm(realm);
 
     if (isProxy)
         Q_EMIT q->proxyAuthenticationRequired(requestUrl, &networkAuth, challengingHost);
-- 
GitLab