7#include "cidreferencesurlinterceptor.h"
8#include "htmlwriter/webengineembedpart.h"
14#include <QWebEngineUrlRequestInfo>
16using namespace MessageViewer;
18CidReferencesUrlInterceptor::CidReferencesUrlInterceptor(
QObject *parent)
19 : WebEngineViewer::NetworkPluginUrlInterceptorInterface(parent)
23CidReferencesUrlInterceptor::~CidReferencesUrlInterceptor() =
default;
25bool CidReferencesUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
27 const QUrl urlRequestUrl(info.requestUrl());
29 if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage) {
30 const QUrl newUrl =
QUrl(MessageViewer::WebEngineEmbedPart::self()->contentUrl(urlRequestUrl.path()));
37 image = image.scaled(800, 600);
38 image.save(&buf,
"png");
45 info.redirect(newUrl);
53#include "moc_cidreferencesurlinterceptor.cpp"
QByteArray toBase64(Base64Options options) const const
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
QString path(ComponentFormattingOptions options) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:46 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.