From 5b5b7d9a5f922ef5fa99cfac41da348e23970032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Mon, 3 Sep 2018 10:25:04 +0200 Subject: Improve QWebEngineUrlScheme API Following feedback from 5.12 API review: - Use enum class for Syntax - Add Q_FLAG for Flags - Mark constructor from name as explicit - Rename Secure to SecureScheme - Rename Local to LocalScheme - Rename addScheme to registerScheme - Rename findScheme to schemeByName Task-number: QTBUG-70247 Change-Id: Iae332c8d9843349506e8a4b07d70f0d234597375 Reviewed-by: Allan Sandfeld Jensen --- examples/webenginewidgets/webui/doc/src/webui.qdoc | 8 ++++---- examples/webenginewidgets/webui/webuihandler.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/webenginewidgets/webui/doc/src/webui.qdoc b/examples/webenginewidgets/webui/doc/src/webui.qdoc index d5eb13d02..47d9fbad1 100644 --- a/examples/webenginewidgets/webui/doc/src/webui.qdoc +++ b/examples/webenginewidgets/webui/doc/src/webui.qdoc @@ -84,7 +84,7 @@ In order to take advantage of these possibilities, the custom scheme must first be registered. This means creating and configuring a \l {QWebEngineUrlScheme} object and then handing it over to \l - {QWebEngineUrlScheme::addScheme()}. The example program does exactly this in + {QWebEngineUrlScheme::registerScheme()}. The example program does exactly this in the static method \c {WebUiHandler::registerUrlScheme()}: \quotefromfile webenginewidgets/webui/webuihandler.cpp @@ -95,11 +95,11 @@ the constructor of \c {QWebEngineUrlScheme} or by calling \l {QWebEngineUrlScheme::setName}. In the above, the name \c {webui} is set through the constructor. Additionally, we activate the flags \l - {QWebEngineUrlScheme::Secure}{Secure}, \l - {QWebEngineUrlScheme::Local}{Local} and \l + {QWebEngineUrlScheme::SecureScheme}{SecureScheme}, \l + {QWebEngineUrlScheme::LocalScheme}{LocalScheme} and \l {QWebEngineUrlScheme::LocalAccessAllowed}{LocalAccessAllowed}. Since our custom scheme handler will not deliver resources received from insecure - network connections, we can safely mark it as \c {Secure}. The \c {Local} + network connections, we can safely mark it as a \c {SecureScheme}. The \c {LocalScheme} flag prevents content from non-local schemes (such as \c {http}) from interacting with our custom scheme. Without this flag it would be possible, for example, to embed the \c {webui:about} page in an \c