diff options
Diffstat (limited to 'src/corelib/tools/qcollator_p.h')
-rw-r--r-- | src/corelib/tools/qcollator_p.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/tools/qcollator_p.h index 526521ebf4..62e3eeb576 100644 --- a/src/corelib/tools/qcollator_p.h +++ b/src/corelib/tools/qcollator_p.h @@ -60,6 +60,8 @@ #include <unicode/ucol.h> #elif defined(Q_OS_OSX) #include <CoreServices/CoreServices.h> +#elif defined(Q_OS_WIN) +#include <qt_windows.h> #endif QT_BEGIN_NAMESPACE @@ -69,17 +71,16 @@ typedef UCollator *CollatorType; typedef QByteArray CollatorKeyType; #elif defined(Q_OS_OSX) +typedef CollatorRef CollatorType; typedef QVector<UCCollationValue> CollatorKeyType; -struct CollatorType { - CollatorType(int opt) : collator(NULL), options(opt) {} - - CollatorRef collator; - UInt32 options; -}; #elif defined(Q_OS_WIN) typedef QString CollatorKeyType; typedef int CollatorType; +# ifdef Q_OS_WINRT +# define USE_COMPARESTRINGEX +# endif + #else //posix typedef QVector<wchar_t> CollatorKeyType; typedef int CollatorType; @@ -90,6 +91,17 @@ class Q_CORE_EXPORT QCollatorPrivate public: QAtomicInt ref; QLocale locale; +#if defined(Q_OS_WIN) && !defined(QT_USE_ICU) +#ifdef USE_COMPARESTRINGEX + QString localeName; +#else + LCID localeID; +#endif +#endif + Qt::CaseSensitivity caseSensitivity; + bool numericMode; + bool ignorePunctuation; + bool dirty; CollatorType collator; @@ -102,7 +114,12 @@ public: void cleanup(); QCollatorPrivate() - : ref(1), collator(0) + : ref(1), + caseSensitivity(Qt::CaseSensitive), + numericMode(false), + ignorePunctuation(false), + dirty(true), + collator(0) { cleanup(); } ~QCollatorPrivate() { cleanup(); } |