From de0dd7fb2db6dfc6c58bde78bfab50dc127f727c Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 8 Oct 2015 22:17:21 +0200 Subject: [PATCH] Fix build with latest QtWebEngine 5.6 --- src/lib/adblock/adblockmanager.cpp | 8 ++++---- src/lib/network/schemehandlers/adblockschemehandler.cpp | 4 ++-- src/lib/network/schemehandlers/qupzillaschemehandler.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/adblock/adblockmanager.cpp b/src/lib/adblock/adblockmanager.cpp index 2880e5d0c..3310b8a0e 100644 --- a/src/lib/adblock/adblockmanager.cpp +++ b/src/lib/adblock/adblockmanager.cpp @@ -91,9 +91,9 @@ bool AdBlockManager::block(QWebEngineUrlRequestInfo &request) QElapsedTimer timer; timer.start(); #endif - const QString urlString = request.url().toEncoded().toLower(); - const QString urlDomain = request.url().host().toLower(); - const QString urlScheme = request.url().scheme().toLower(); + const QString urlString = request.requestUrl().toEncoded().toLower(); + const QString urlDomain = request.requestUrl().host().toLower(); + const QString urlScheme = request.requestUrl().scheme().toLower(); if (!isEnabled() || !canRunOnScheme(urlScheme)) return 0; @@ -103,7 +103,7 @@ bool AdBlockManager::block(QWebEngineUrlRequestInfo &request) if (blockedRule) { res = true; - request.blockRequest(true); + request.block(true); #ifdef ADBLOCK_DEBUG qDebug() << "BLOCKED: " << timer.elapsed() << blockedRule->filter() << request.url(); #endif diff --git a/src/lib/network/schemehandlers/adblockschemehandler.cpp b/src/lib/network/schemehandlers/adblockschemehandler.cpp index 99f6d63a5..0825f50ba 100644 --- a/src/lib/network/schemehandlers/adblockschemehandler.cpp +++ b/src/lib/network/schemehandlers/adblockschemehandler.cpp @@ -32,8 +32,8 @@ AdBlockSchemeHandler::AdBlockSchemeHandler(QObject *parent) void AdBlockSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job) { // Ignore the request - job->setReply(QByteArray(), new QBuffer()); - //job->setError(QWebEngineUrlRequestJob::RequestAborted); + job->reply(QByteArray(), new QBuffer()); + //job->fail(QWebEngineUrlRequestJob::RequestAborted); const QUrl url = job->requestUrl(); const QList > queryItems = QUrlQuery(url).queryItems(); diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index f81c7dcb0..60c470e35 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -48,10 +48,10 @@ void QupZillaSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job) knownPages << "about" << "reportbug" << "start" << "speeddial" << "config" << "restore"; if (knownPages.contains(job->requestUrl().path())) - job->setReply(QByteArrayLiteral("text/html"), new QupZillaSchemeReply(job)); + job->reply(QByteArrayLiteral("text/html"), new QupZillaSchemeReply(job)); else - job->setReply(QByteArray(), new QBuffer()); - //m_job->setError(QWebEngineUrlRequestJob::UrlNotFound); + job->reply(QByteArray(), new QBuffer()); + //job->fail(QWebEngineUrlRequestJob::UrlNotFound); } QupZillaSchemeReply::QupZillaSchemeReply(QWebEngineUrlRequestJob *job, QObject *parent)