diff options
-rw-r--r-- | dist/changes-5.0.0 | 2 | ||||
-rw-r--r-- | src/corelib/io/qurl.cpp | 3 | ||||
-rw-r--r-- | src/corelib/tools/qchar.h | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index caf7e3023f..344edb6517 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -40,8 +40,6 @@ QtCore ------ * drop a bogus QChar::NoCategory enum value; the proper QChar::Other_NotAssigned value is returned for an unassigned codepoints now. -* QChar::Unicode_Unassigned value was moved to the end of enum in order to make - the version based checks more convenient and less error-prone in use. QtGui ----- diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index ef58e90dba..b948a43080 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2973,7 +2973,8 @@ void qt_nameprep(QString *source, int from) } } if (!isUnassignedAllowed) { - if (QChar::unicodeVersion(uc) > QChar::Unicode_3_2) { + QChar::UnicodeVersion version = QChar::unicodeVersion(uc); + if (version == QChar::Unicode_Unassigned || version > QChar::Unicode_3_2) { source->resize(from); // not allowed, clear the label return; } diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h index 9047b6a9da..af50f6dde7 100644 --- a/src/corelib/tools/qchar.h +++ b/src/corelib/tools/qchar.h @@ -190,6 +190,7 @@ public: }; enum UnicodeVersion { + Unicode_Unassigned, // ### Qt 5: assign with some constantly big value Unicode_1_1, Unicode_2_0, Unicode_2_1_2, @@ -198,8 +199,7 @@ public: Unicode_3_2, Unicode_4_0, Unicode_4_1, - Unicode_5_0, - Unicode_Unassigned = 0xff + Unicode_5_0 }; // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO |