Commit b9d74ba3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix initialize QWebEngineUrlScheme

parent 0335a760
Pipeline #21683 passed with stage
in 17 minutes and 27 seconds
......@@ -52,7 +52,6 @@
#include <KActionMenu>
#include <KCharsets>
#include <QPrintPreviewDialog>
#include <QWebEngineUrlScheme>
#include <QMenu>
#include <KMessageBox>
......@@ -195,10 +194,7 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollec
+ QByteArray::number(reinterpret_cast<quintptr>(this)), this))
, mPreviouslyViewedItemId(-1)
{
QWebEngineUrlScheme cidScheme("cid");
cidScheme.setFlags(QWebEngineUrlScheme::SecureScheme | QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
cidScheme.setSyntax(QWebEngineUrlScheme::Syntax::Path);
QWebEngineUrlScheme::registerScheme(cidScheme);
MailWebEngineView::initializeCustomScheme();
if (!mainWindow) {
mMainWindow = aParent;
......
......@@ -37,6 +37,7 @@
#include <QWebEngineProfile>
#include <QPrinter>
#include <QWebEngineUrlScheme>
#include <WebEngineViewer/WebHitTestResult>
......@@ -386,3 +387,12 @@ bool MailWebEngineView::execPrintPreviewPage(QPrinter *printer, int timeout)
{
return d->mPageEngine->execPrintPreviewPage(printer, timeout);
}
void MailWebEngineView::initializeCustomScheme()
{
QWebEngineUrlScheme cidScheme("cid");
cidScheme.setFlags(QWebEngineUrlScheme::SecureScheme | QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
cidScheme.setSyntax(QWebEngineUrlScheme::Syntax::Path);
QWebEngineUrlScheme::registerScheme(cidScheme);
}
......@@ -72,6 +72,8 @@ public:
void setViewer(MessageViewer::ViewerPrivate *viewer);
Q_REQUIRED_RESULT bool execPrintPreviewPage(QPrinter *printer, int timeout);
void readConfig();
static void initializeCustomScheme();
public Q_SLOTS:
void slotZoomChanged(qreal zoom);
void slotShowDetails();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment