From cff38329aa8635ac8a0696b0aa78782fe5605d16 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 20 Oct 2011 16:23:41 +0200 Subject: Re-introduce support for QUrl::errorString() Note that QUrl can only remember one error. If the URL contains more than one error condition, only the latest (in whichever parsing order URL decides to use) will be reported. I don't want too keep too much data in QUrlPrivate for validation, so let's use 4 bytes only. Change-Id: I2afbf80734d3633f41f779984ab76b3a5ba293a2 Reviewed-by: Lars Knoll --- src/corelib/io/qurl_p.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/corelib/io/qurl_p.h') diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h index 6a0af1c90a..d9207bd809 100644 --- a/src/corelib/io/qurl_p.h +++ b/src/corelib/io/qurl_p.h @@ -57,24 +57,6 @@ QT_BEGIN_NAMESPACE -struct QUrlErrorInfo { - inline QUrlErrorInfo() : _source(0), _message(0), _expected(0), _found(0) - { } - - const char *_source; - const char *_message; - char _expected; - char _found; - - inline void setParams(const char *source, const char *message, char expected, char found) - { - _source = source; - _message = message; - _expected = expected; - _found = found; - } -}; - class QUrlPrivate { public: @@ -92,6 +74,24 @@ public: Fragment = 0x80 }; + enum ErrorCode { + InvalidSchemeError = 0x000, + SchemeEmptyError, + + InvalidRegNameError = 0x800, + InvalidIPv4AddressError, + InvalidIPv6AddressError, + InvalidIPvFutureError, + HostMissingEndBracket, + + InvalidPortError = 0x1000, + PortEmptyError, + + PathContainsColonBeforeSlash = 0x2000, + + NoError = 0xffff + }; + QUrlPrivate(); QUrlPrivate(const QUrlPrivate ©); @@ -143,6 +143,9 @@ public: QString query; QString fragment; + ushort errorCode; + ushort errorSupplement; + // not used for: // - Port (port == -1 means absence) // - Path (there's no path delimiter, so we optimize its use out of existence) @@ -152,9 +155,6 @@ public: // UserName, Password, Path, Query, and Fragment never contain errors in TolerantMode. // Those flags are set only by the strict parser. uchar sectionHasError; - - mutable QUrlErrorInfo errorInfo; - QString createErrorString(); }; -- cgit v1.2.3