From 69cd7e8f7001b58939055bf75066b2c439233b0e Mon Sep 17 00:00:00 2001 From: Kurt Pattyn Date: Sun, 13 Oct 2013 20:14:20 +0200 Subject: Clarify that the URL scheme does not include the ':' From the documentation of setScheme it was not clear if the scheme should be terminated by a ':' or not. Documentation has been updated to clarify the expected syntax for the scheme. Change-Id: Ied8533beef7daa12e1d5e7da0649c184efb84522 Reviewed-by: David Faure Reviewed-by: Thiago Macieira --- src/corelib/io/qurl.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 6b7c5bde2d..fe5faa2be7 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -1840,12 +1840,21 @@ void QUrl::setUrl(const QString &url, ParsingMode parsingMode) input. It must also start with an ASCII letter. The scheme describes the type (or protocol) of the URL. It's - represented by one or more ASCII characters at the start the URL, - and is followed by a ':'. The following example shows a URL where - the scheme is "ftp": + represented by one or more ASCII characters at the start the URL. + + A scheme is strictly \l {http://www.ietf.org/rfc/rfc3986.txt} {RFC 3986}-compliant: + \tt {scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )} + + The following example shows a URL where the scheme is "ftp": \image qurl-authority2.png + To set the scheme, the following call is used: + \code + QUrl url; + url.setScheme("ftp"); + \endcode + The scheme can also be empty, in which case the URL is interpreted as relative. @@ -3327,7 +3336,7 @@ QString QUrl::fromPercentEncoding(const QByteArray &input) them to \a include. Unreserved is defined as: - ALPHA / DIGIT / "-" / "." / "_" / "~" + \tt {ALPHA / DIGIT / "-" / "." / "_" / "~"} \snippet code/src_corelib_io_qurl.cpp 6 */ -- cgit v1.2.3