Some refactoring in network manager.

This commit is contained in:
Martin Rotter 2015-06-24 09:18:45 +02:00
parent aaa12e9183
commit aa5dd662db
2 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@
QPointer<WebBrowserNetworkAccessManager> WebBrowserNetworkAccessManager::s_instance;
WebBrowserNetworkAccessManager::WebBrowserNetworkAccessManager(WebPage *page, QObject *parent)
: BaseNetworkAccessManager(parent), page_(page) {
: BaseNetworkAccessManager(parent), m_page(page) {
connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(onAuthenticationRequired(QNetworkReply*,QAuthenticator*)));
}
@ -44,9 +44,9 @@ void WebBrowserNetworkAccessManager::onAuthenticationRequired(QNetworkReply *rep
}
QNetworkReply *WebBrowserNetworkAccessManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData) {
if (page_) {
if (m_page != NULL) {
QNetworkRequest pageRequest = request;
page_->populateNetworkRequest(pageRequest);
m_page->populateNetworkRequest(pageRequest);
return WebBrowserNetworkAccessManager::instance()->createRequest(op, pageRequest, outgoingData);
}

View File

@ -42,7 +42,7 @@ class WebBrowserNetworkAccessManager : public BaseNetworkAccessManager {
void onAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator);
private:
WebPage* page_;
WebPage *m_page;
static QPointer<WebBrowserNetworkAccessManager> s_instance;