Messagelib
7#include "cidreferencesurlinterceptor.h"
8#include "htmlwriter/webengineembedpart.h"
11#include <QWebEngineUrlRequestInfo>
16using namespace MessageViewer;
17CidReferencesUrlInterceptor::CidReferencesUrlInterceptor(
QObject *parent)
18 : WebEngineViewer::NetworkPluginUrlInterceptorInterface(parent)
22CidReferencesUrlInterceptor::~CidReferencesUrlInterceptor() =
default;
24bool CidReferencesUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
26 const QUrl urlRequestUrl(info.requestUrl());
27 if (urlRequestUrl.scheme() == QLatin1StringView(
"cid")) {
28 if (info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage) {
29 const QUrl newUrl = QUrl(MessageViewer::WebEngineEmbedPart::self()->contentUrl(urlRequestUrl.path()));
31 info.redirect(newUrl);
38#include "moc_cidreferencesurlinterceptor.cpp"
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:05:42 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.