summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-03-30 17:48:42 -0300
committerQt by Nokia <qt-info@nokia.com>2012-04-11 23:32:26 +0200
commit1b7e9dba75f18342911bc6954be3e754322f091f (patch)
tree1dfb775910294ff8d02e60cfa9c2bf178baa6221 /src/corelib/io/qurl.h
parent997ac954abe8e4f7d9323f13a79989f277de8301 (diff)
Change the component formatting enum values so the default is zero
By having the default value equal to zero, we follow the principle of least surprise. For example, if we had url.path() and we refactored to url.path(QUrl::DecodeSpaces) Then instead of ensuring spaces are decoded, we make spaces the only thing encoded (unicode, delimiters and reserved characters are encoded). Besides, modifying the default can only be used to encode something that wasn't encoded previously, so having the enums as Encode makes more sense. As a side-effect, toEncoded() does not support any extra encoding options. Change-Id: I2624ec446e65c2d979e9ca2f81bd3db22b00bb13 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/corelib/io/qurl.h')
-rw-r--r--src/corelib/io/qurl.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index ff46a8ac1a..dbfc327caf 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -138,15 +138,15 @@ public:
};
enum ComponentFormattingOption {
- FullyEncoded = 0x000000,
- DecodeSpaces = 0x100000,
- DecodeUnicode = 0x200000,
- DecodeDelimiters = 0x400000 | 0x800000,
- PrettyDecodeReserved = 0x1000000,
- DecodeReserved = PrettyDecodeReserved | 0x2000000,
-
- PrettyDecoded = DecodeSpaces | DecodeDelimiters | PrettyDecodeReserved | DecodeUnicode,
- MostDecoded = PrettyDecoded
+ PrettyDecoded = 0x000000,
+ EncodeSpaces = 0x100000,
+ EncodeUnicode = 0x200000,
+ EncodeDelimiters = 0x400000 | 0x800000,
+ EncodeReserved = 0x1000000,
+ DecodeReserved = 0x2000000,
+
+ FullyEncoded = EncodeSpaces | EncodeUnicode | EncodeDelimiters | EncodeReserved,
+ MostDecoded = PrettyDecoded | DecodeReserved
};
Q_DECLARE_FLAGS(ComponentFormattingOptions, ComponentFormattingOption)
#ifdef qdoc
@@ -331,8 +331,6 @@ inline QIncompatibleFlag operator|(QUrl::UrlFormattingOption f1, int f2)
{ return QIncompatibleFlag(int(f1) | f2); }
// add operators for OR'ing the two types of flags
-inline QUrl::FormattingOptions &operator|=(QUrl::FormattingOptions &i, QUrl::ComponentFormattingOption f)
-{ i |= QUrl::UrlFormattingOption(int(f)); return i; }
inline QUrl::FormattingOptions &operator|=(QUrl::FormattingOptions &i, QUrl::ComponentFormattingOptions f)
{ i |= QUrl::UrlFormattingOption(int(f)); return i; }
Q_DECL_CONSTEXPR inline QUrl::FormattingOptions operator|(QUrl::UrlFormattingOption i, QUrl::ComponentFormattingOption f)