mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Fix build with latest QtWebEngine 5.6
This commit is contained in:
parent
4a96fd7073
commit
de0dd7fb2d
|
@ -91,9 +91,9 @@ bool AdBlockManager::block(QWebEngineUrlRequestInfo &request)
|
||||||
QElapsedTimer timer;
|
QElapsedTimer timer;
|
||||||
timer.start();
|
timer.start();
|
||||||
#endif
|
#endif
|
||||||
const QString urlString = request.url().toEncoded().toLower();
|
const QString urlString = request.requestUrl().toEncoded().toLower();
|
||||||
const QString urlDomain = request.url().host().toLower();
|
const QString urlDomain = request.requestUrl().host().toLower();
|
||||||
const QString urlScheme = request.url().scheme().toLower();
|
const QString urlScheme = request.requestUrl().scheme().toLower();
|
||||||
|
|
||||||
if (!isEnabled() || !canRunOnScheme(urlScheme))
|
if (!isEnabled() || !canRunOnScheme(urlScheme))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -103,7 +103,7 @@ bool AdBlockManager::block(QWebEngineUrlRequestInfo &request)
|
||||||
|
|
||||||
if (blockedRule) {
|
if (blockedRule) {
|
||||||
res = true;
|
res = true;
|
||||||
request.blockRequest(true);
|
request.block(true);
|
||||||
#ifdef ADBLOCK_DEBUG
|
#ifdef ADBLOCK_DEBUG
|
||||||
qDebug() << "BLOCKED: " << timer.elapsed() << blockedRule->filter() << request.url();
|
qDebug() << "BLOCKED: " << timer.elapsed() << blockedRule->filter() << request.url();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,8 +32,8 @@ AdBlockSchemeHandler::AdBlockSchemeHandler(QObject *parent)
|
||||||
void AdBlockSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
|
void AdBlockSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
|
||||||
{
|
{
|
||||||
// Ignore the request
|
// Ignore the request
|
||||||
job->setReply(QByteArray(), new QBuffer());
|
job->reply(QByteArray(), new QBuffer());
|
||||||
//job->setError(QWebEngineUrlRequestJob::RequestAborted);
|
//job->fail(QWebEngineUrlRequestJob::RequestAborted);
|
||||||
|
|
||||||
const QUrl url = job->requestUrl();
|
const QUrl url = job->requestUrl();
|
||||||
const QList<QPair<QString, QString> > queryItems = QUrlQuery(url).queryItems();
|
const QList<QPair<QString, QString> > queryItems = QUrlQuery(url).queryItems();
|
||||||
|
|
|
@ -48,10 +48,10 @@ void QupZillaSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
|
||||||
knownPages << "about" << "reportbug" << "start" << "speeddial" << "config" << "restore";
|
knownPages << "about" << "reportbug" << "start" << "speeddial" << "config" << "restore";
|
||||||
|
|
||||||
if (knownPages.contains(job->requestUrl().path()))
|
if (knownPages.contains(job->requestUrl().path()))
|
||||||
job->setReply(QByteArrayLiteral("text/html"), new QupZillaSchemeReply(job));
|
job->reply(QByteArrayLiteral("text/html"), new QupZillaSchemeReply(job));
|
||||||
else
|
else
|
||||||
job->setReply(QByteArray(), new QBuffer());
|
job->reply(QByteArray(), new QBuffer());
|
||||||
//m_job->setError(QWebEngineUrlRequestJob::UrlNotFound);
|
//job->fail(QWebEngineUrlRequestJob::UrlNotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
QupZillaSchemeReply::QupZillaSchemeReply(QWebEngineUrlRequestJob *job, QObject *parent)
|
QupZillaSchemeReply::QupZillaSchemeReply(QWebEngineUrlRequestJob *job, QObject *parent)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user