diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2018-03-01 14:55:01 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2018-03-08 14:41:10 +0000 |
commit | a03fb5fc7ac03c35739324d63eb29da756e1e908 (patch) | |
tree | 85fe63d86d1ffcb37cbb937c02579040b72e6a3a | |
parent | 349d11dd83578b5baeec87e41c71f612e5bd21b3 (diff) |
Rename protocol() to scheme() in QWERPHPermissionRequest
Scheme refers to a part of a URL. Protocol refers to a formal standard for
communication over a network. Therefore scheme is more accurate here, since
registerProtocolHandler only defines simple aliases.
Change-Id: I71a1511aa92e41c3e3aca4c0403f54af6d91c563
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
8 files changed, 16 insertions, 16 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index 15a8d96fe..55a35d611 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -446,7 +446,7 @@ ApplicationWindow { } onRegisterProtocolHandlerPermissionRequested: { - print("accepting registerProtocolHandler permission request for " + request.protocol + " from " + request.origin); + print("accepting registerProtocolHandler permission request for " + request.scheme + " from " + request.origin); request.accept(); } diff --git a/examples/webenginewidgets/simplebrowser/webpage.cpp b/examples/webenginewidgets/simplebrowser/webpage.cpp index ef55fd33d..48a9d86b9 100644 --- a/examples/webenginewidgets/simplebrowser/webpage.cpp +++ b/examples/webenginewidgets/simplebrowser/webpage.cpp @@ -151,7 +151,7 @@ void WebPage::handleRegisterProtocolHandlerPermissionRequested(QWebEngineRegiste tr("Permission Request"), tr("Allow %1 to open all %2 links?") .arg(request.origin().host()) - .arg(request.protocol())); + .arg(request.scheme())); if (answer == QMessageBox::Yes) request.accept(); else diff --git a/src/core/api/qwebengineregisterprotocolhandlerpermissionrequest.cpp b/src/core/api/qwebengineregisterprotocolhandlerpermissionrequest.cpp index 1d893bd1c..b7301af76 100644 --- a/src/core/api/qwebengineregisterprotocolhandlerpermissionrequest.cpp +++ b/src/core/api/qwebengineregisterprotocolhandlerpermissionrequest.cpp @@ -95,14 +95,14 @@ QUrl QWebEngineRegisterProtocolHandlerPermissionRequest::origin() const } /*! - \property QWebEngineRegisterProtocolHandlerPermissionRequest::protocol + \property QWebEngineRegisterProtocolHandlerPermissionRequest::scheme \brief The URL scheme for the protocol handler. This is the first parameter from the \l registerProtocolHandler call. */ -QString QWebEngineRegisterProtocolHandlerPermissionRequest::protocol() const +QString QWebEngineRegisterProtocolHandlerPermissionRequest::scheme() const { - return d_ptr->protocol(); + return d_ptr->scheme(); } /*! \fn bool QWebEngineRegisterProtocolHandlerPermissionRequest::operator==(const QWebEngineRegisterProtocolHandlerPermissionRequest &that) const diff --git a/src/core/api/qwebengineregisterprotocolhandlerpermissionrequest.h b/src/core/api/qwebengineregisterprotocolhandlerpermissionrequest.h index 43ddf35e4..254f26508 100644 --- a/src/core/api/qwebengineregisterprotocolhandlerpermissionrequest.h +++ b/src/core/api/qwebengineregisterprotocolhandlerpermissionrequest.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QWEBENGINE_EXPORT QWebEngineRegisterProtocolHandlerPermissionRequest { Q_GADGET Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL) - Q_PROPERTY(QString protocol READ protocol CONSTANT FINAL) + Q_PROPERTY(QString scheme READ scheme CONSTANT FINAL) public: QWebEngineRegisterProtocolHandlerPermissionRequest() {} QWebEngineRegisterProtocolHandlerPermissionRequest( @@ -61,7 +61,7 @@ public: Q_INVOKABLE void accept(); Q_INVOKABLE void reject(); QUrl origin() const; - QString protocol() const; + QString scheme() const; bool operator==(const QWebEngineRegisterProtocolHandlerPermissionRequest &that) const { return d_ptr == that.d_ptr; } bool operator!=(const QWebEngineRegisterProtocolHandlerPermissionRequest &that) const { return d_ptr != that.d_ptr; } private: diff --git a/src/core/register_protocol_handler_permission_controller.h b/src/core/register_protocol_handler_permission_controller.h index 54e16f569..ce1e84084 100644 --- a/src/core/register_protocol_handler_permission_controller.h +++ b/src/core/register_protocol_handler_permission_controller.h @@ -46,15 +46,15 @@ namespace QtWebEngineCore { class QWEBENGINE_EXPORT RegisterProtocolHandlerPermissionController : public PermissionController { public: - RegisterProtocolHandlerPermissionController(QUrl origin, QString protocol) + RegisterProtocolHandlerPermissionController(QUrl origin, QString scheme) : PermissionController(std::move(origin)) - , m_protocol(std::move(protocol)) + , m_scheme(std::move(scheme)) {} - QString protocol() const { return m_protocol; } + QString scheme() const { return m_scheme; } private: - QString m_protocol; + QString m_scheme; }; } // namespace QtWebEngineCore diff --git a/src/webengine/doc/src/webengineview_lgpl.qdoc b/src/webengine/doc/src/webengineview_lgpl.qdoc index 93f4b555d..761eb2a2c 100644 --- a/src/webengine/doc/src/webengineview_lgpl.qdoc +++ b/src/webengine/doc/src/webengineview_lgpl.qdoc @@ -1385,7 +1385,7 @@ */ /*! - \qmlproperty string RegisterProtocolHandlerPermissionRequest::protocol + \qmlproperty string RegisterProtocolHandlerPermissionRequest::scheme \brief The URL scheme for the protocol handler. This is the first parameter from the \l registerProtocolHandler call. diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index 0da6e71cc..efd063512 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -688,7 +688,7 @@ static QStringList expectedAPI = QStringList() << "QWebEngineRegisterProtocolHandlerPermissionRequest.accept() --> void" << "QWebEngineRegisterProtocolHandlerPermissionRequest.origin --> QUrl" << "QWebEngineRegisterProtocolHandlerPermissionRequest.reject() --> void" - << "QWebEngineRegisterProtocolHandlerPermissionRequest.protocol --> QString" + << "QWebEngineRegisterProtocolHandlerPermissionRequest.scheme --> QString" ; static bool isCheckedEnum(const QByteArray &typeName) diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 8fc52be60..7b9cc31e9 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -4238,16 +4238,16 @@ void tst_QWebEnginePage::registerProtocolHandler() QCOMPARE(loadSpy.takeFirst().value(0).toBool(), true); QString callFormat = QStringLiteral("window.navigator.registerProtocolHandler(\"%1\", \"%2\", \"%3\")"); - QString protocol = QStringLiteral("mailto"); + QString scheme = QStringLiteral("mailto"); QString url = server.url("/mail").toString() + QStringLiteral("?uri=%s"); QString title; - QString call = callFormat.arg(protocol).arg(url).arg(title); + QString call = callFormat.arg(scheme).arg(url).arg(title); page.runJavaScript(call); QTRY_COMPARE(permissionSpy.count(), 1); auto request = permissionSpy.takeFirst().value(0).value<QWebEngineRegisterProtocolHandlerPermissionRequest>(); QCOMPARE(request.origin(), QUrl(url)); - QCOMPARE(request.protocol(), protocol); + QCOMPARE(request.scheme(), scheme); if (permission) request.accept(); else |