summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-06-02 00:38:48 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-10 19:09:04 +0200
commitb2c1550564b6cdf2b1cce262355c6b7f8b9b425a (patch)
treefbbe5468ff5d698e5d6858ec10992305074bdbbb /src/corelib/tools/qstring.cpp
parent1e9be1327bed93542816abb1aef6bcee25216ce0 (diff)
Use QCollator in QString and remove it from qlocale_icu
Change-Id: Ic94439943999382f8050668edfb67d3b75ac1df4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 4f8d0e5614..493661bad1 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -59,6 +59,7 @@
#include "qhash.h"
#include "qdebug.h"
#include "qendian.h"
+#include "qcollator_p.h"
#ifdef Q_OS_MAC
#include <private/qcore_mac_p.h>
@@ -5003,14 +5004,10 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1,
CFRelease(thisString);
CFRelease(otherString);
return result;
+#elif defined(QT_USE_ICU)
+ QCollator collator;
+ return collator.compare(data1, length1, data2, length2);
#elif defined(Q_OS_UNIX)
-# if defined(QT_USE_ICU)
- QLocale locale;
- int res;
- if (QIcu::strcoll(locale.d.constData()->m_localeID, data1, length1, data2, length2, &res))
- return res;
- // else fall through
-# endif
// declared in <string.h>
int delta = strcoll(toLocal8Bit_helper(data1, length1).constData(), toLocal8Bit_helper(data2, length2).constData());
if (delta == 0)