diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qurl.cpp | 17 | ||||
-rw-r--r-- | src/corelib/io/qurl.h | 5 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 0821645111..cbe39e9fdf 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -382,7 +382,14 @@ static const ushort encodedPathActions[] = { leave('/'), // 4 0 }; -static const ushort * const decodedPathInUrlActions = encodedPathActions + 2; +static const ushort decodedPathInUrlActions[] = { + decode('{'), // 0 + decode('}'), // 1 + encode('?'), // 2 + encode('#'), // 3 + leave('/'), // 4 + 0 +}; static const ushort * const decodedPathInIsolationActions = encodedPathActions + 4; // leave('/') static const ushort encodedFragmentActions[] = { @@ -425,12 +432,6 @@ static const ushort decodedQueryInIsolationActions[] = { 0 }; static const ushort decodedQueryInUrlActions[] = { - decode('"'), // 0 - decode('<'), // 1 - decode('>'), // 2 - decode('^'), // 3 - decode('\\'),// 4 - decode('|'), // 5 decode('{'), // 6 decode('}'), // 7 encode('#'), // 8 @@ -2054,6 +2055,8 @@ QString QUrl::toString(FormattingOptions options) const } QString url; + if (!options.testFlag(DecodeReserved)) + options &= ~DecodeReserved; if (!(options & QUrl::RemoveScheme) && d->hasScheme()) url += d->scheme + QLatin1Char(':'); diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 27b81dfc0f..ff46a8ac1a 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -142,9 +142,10 @@ public: DecodeSpaces = 0x100000, DecodeUnicode = 0x200000, DecodeDelimiters = 0x400000 | 0x800000, - DecodeReserved = 0x1000000, + PrettyDecodeReserved = 0x1000000, + DecodeReserved = PrettyDecodeReserved | 0x2000000, - PrettyDecoded = DecodeSpaces | DecodeDelimiters | DecodeReserved | DecodeUnicode, + PrettyDecoded = DecodeSpaces | DecodeDelimiters | PrettyDecodeReserved | DecodeUnicode, MostDecoded = PrettyDecoded }; Q_DECLARE_FLAGS(ComponentFormattingOptions, ComponentFormattingOption) |