diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qalgorithms.h | 86 | ||||
-rw-r--r-- | src/corelib/tools/qcollator_win.cpp | 24 | ||||
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 3 | ||||
-rw-r--r-- | src/corelib/tools/qlocale_win.cpp | 206 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 13 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 3 | ||||
-rw-r--r-- | src/corelib/tools/qtimezone.cpp | 6 | ||||
-rw-r--r-- | src/corelib/tools/tools.pri | 7 |
8 files changed, 272 insertions, 76 deletions
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h index c6eede05cb..f75f33f25c 100644 --- a/src/corelib/tools/qalgorithms.h +++ b/src/corelib/tools/qalgorithms.h @@ -55,28 +55,28 @@ namespace QAlgorithmsPrivate { #if QT_DEPRECATED_SINCE(5, 2) template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan); +QT_DEPRECATED_X("Use std::sort") Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan); template <typename RandomAccessIterator, typename T> -QT_DEPRECATED inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy); +QT_DEPRECATED_X("Use std::sort") inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy); template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan); +QT_DEPRECATED_X("Use std::stable_sort") Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan); template <typename RandomAccessIterator, typename T> -QT_DEPRECATED inline void qStableSortHelper(RandomAccessIterator, RandomAccessIterator, const T &); +QT_DEPRECATED_X("Use std::stable_sort") inline void qStableSortHelper(RandomAccessIterator, RandomAccessIterator, const T &); template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); +QT_DEPRECATED_X("Use std::lower_bound") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); +QT_DEPRECATED_X("Use std::upper_bound") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); +QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); #endif // QT_DEPRECATED_SINCE(5, 2) } #if QT_DEPRECATED_SINCE(5, 2) template <typename InputIterator, typename OutputIterator> -QT_DEPRECATED inline OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest) +QT_DEPRECATED_X("Use std::copy") inline OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest) { while (begin != end) *dest++ = *begin++; @@ -84,7 +84,7 @@ QT_DEPRECATED inline OutputIterator qCopy(InputIterator begin, InputIterator end } template <typename BiIterator1, typename BiIterator2> -QT_DEPRECATED inline BiIterator2 qCopyBackward(BiIterator1 begin, BiIterator1 end, BiIterator2 dest) +QT_DEPRECATED_X("Use std::copy_backward") inline BiIterator2 qCopyBackward(BiIterator1 begin, BiIterator1 end, BiIterator2 dest) { while (begin != end) *--dest = *--end; @@ -92,7 +92,7 @@ QT_DEPRECATED inline BiIterator2 qCopyBackward(BiIterator1 begin, BiIterator1 en } template <typename InputIterator1, typename InputIterator2> -QT_DEPRECATED inline bool qEqual(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) +QT_DEPRECATED_X("Use std::equal") inline bool qEqual(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) { for (; first1 != last1; ++first1, ++first2) if (!(*first1 == *first2)) @@ -101,20 +101,20 @@ QT_DEPRECATED inline bool qEqual(InputIterator1 first1, InputIterator1 last1, In } template <typename ForwardIterator, typename T> -QT_DEPRECATED inline void qFill(ForwardIterator first, ForwardIterator last, const T &val) +QT_DEPRECATED_X("Use std::fill") inline void qFill(ForwardIterator first, ForwardIterator last, const T &val) { for (; first != last; ++first) *first = val; } template <typename Container, typename T> -QT_DEPRECATED inline void qFill(Container &container, const T &val) +QT_DEPRECATED_X("Use std::fill") inline void qFill(Container &container, const T &val) { qFill(container.begin(), container.end(), val); } template <typename InputIterator, typename T> -QT_DEPRECATED inline InputIterator qFind(InputIterator first, InputIterator last, const T &val) +QT_DEPRECATED_X("Use std::find") inline InputIterator qFind(InputIterator first, InputIterator last, const T &val) { while (first != last && !(*first == val)) ++first; @@ -122,13 +122,13 @@ QT_DEPRECATED inline InputIterator qFind(InputIterator first, InputIterator last } template <typename Container, typename T> -QT_DEPRECATED inline typename Container::const_iterator qFind(const Container &container, const T &val) +QT_DEPRECATED_X("Use std::find") inline typename Container::const_iterator qFind(const Container &container, const T &val) { return qFind(container.constBegin(), container.constEnd(), val); } template <typename InputIterator, typename T, typename Size> -QT_DEPRECATED inline void qCount(InputIterator first, InputIterator last, const T &value, Size &n) +QT_DEPRECATED_X("Use std::count") inline void qCount(InputIterator first, InputIterator last, const T &value, Size &n) { for (; first != last; ++first) if (*first == value) @@ -136,7 +136,7 @@ QT_DEPRECATED inline void qCount(InputIterator first, InputIterator last, const } template <typename Container, typename T, typename Size> -QT_DEPRECATED inline void qCount(const Container &container, const T &value, Size &n) +QT_DEPRECATED_X("Use std::count") inline void qCount(const Container &container, const T &value, Size &n) { qCount(container.constBegin(), container.constEnd(), value, n); } @@ -153,7 +153,7 @@ LessThan qGreater() } #else template <typename T> -class QT_DEPRECATED qLess +class QT_DEPRECATED_X("Use std::less") qLess { public: inline bool operator()(const T &t1, const T &t2) const @@ -163,7 +163,7 @@ public: }; template <typename T> -class QT_DEPRECATED qGreater +class QT_DEPRECATED_X("Use std::greater") qGreater { public: inline bool operator()(const T &t1, const T &t2) const @@ -174,21 +174,21 @@ public: #endif template <typename RandomAccessIterator> -QT_DEPRECATED inline void qSort(RandomAccessIterator start, RandomAccessIterator end) +QT_DEPRECATED_X("Use std::sort") inline void qSort(RandomAccessIterator start, RandomAccessIterator end) { if (start != end) QAlgorithmsPrivate::qSortHelper(start, end, *start); } template <typename RandomAccessIterator, typename LessThan> -QT_DEPRECATED inline void qSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan) +QT_DEPRECATED_X("Use std::sort") inline void qSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan) { if (start != end) QAlgorithmsPrivate::qSortHelper(start, end, *start, lessThan); } template<typename Container> -QT_DEPRECATED inline void qSort(Container &c) +QT_DEPRECATED_X("Use std::sort") inline void qSort(Container &c) { #ifdef Q_CC_BOR // Work around Borland 5.5 optimizer bug @@ -199,21 +199,21 @@ QT_DEPRECATED inline void qSort(Container &c) } template <typename RandomAccessIterator> -QT_DEPRECATED inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end) +QT_DEPRECATED_X("Use std::stable_sort") inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end) { if (start != end) QAlgorithmsPrivate::qStableSortHelper(start, end, *start); } template <typename RandomAccessIterator, typename LessThan> -QT_DEPRECATED inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan) +QT_DEPRECATED_X("Use std::stable_sort") inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan) { if (start != end) QAlgorithmsPrivate::qStableSortHelper(start, end, *start, lessThan); } template<typename Container> -QT_DEPRECATED inline void qStableSort(Container &c) +QT_DEPRECATED_X("Use std::stable_sort") inline void qStableSort(Container &c) { #ifdef Q_CC_BOR // Work around Borland 5.5 optimizer bug @@ -224,7 +224,7 @@ QT_DEPRECATED inline void qStableSort(Container &c) } template <typename RandomAccessIterator, typename T> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value) +QT_DEPRECATED_X("Use std::lower_bound") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value) { // Implementation is duplicated from QAlgorithmsPrivate to keep existing code // compiling. We have to allow using *begin and value with different types, @@ -247,19 +247,19 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccess } template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +QT_DEPRECATED_X("Use std::lower_bound") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) { return QAlgorithmsPrivate::qLowerBoundHelper(begin, end, value, lessThan); } template <typename Container, typename T> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qLowerBound(const Container &container, const T &value) +QT_DEPRECATED_X("Use std::lower_bound") Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qLowerBound(const Container &container, const T &value) { return QAlgorithmsPrivate::qLowerBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>()); } template <typename RandomAccessIterator, typename T> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value) +QT_DEPRECATED_X("Use std::upper_bound") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value) { // Implementation is duplicated from QAlgorithmsPrivate. RandomAccessIterator middle; @@ -280,19 +280,19 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound(RandomAccess } template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +QT_DEPRECATED_X("Use std::upper_bound") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) { return QAlgorithmsPrivate::qUpperBoundHelper(begin, end, value, lessThan); } template <typename Container, typename T> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qUpperBound(const Container &container, const T &value) +QT_DEPRECATED_X("Use std::upper_bound") Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qUpperBound(const Container &container, const T &value) { return QAlgorithmsPrivate::qUpperBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>()); } template <typename RandomAccessIterator, typename T> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value) +QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value) { // Implementation is duplicated from QAlgorithmsPrivate. RandomAccessIterator it = qLowerBound(begin, end, value); @@ -304,13 +304,13 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccess } template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) { return QAlgorithmsPrivate::qBinaryFindHelper(begin, end, value, lessThan); } template <typename Container, typename T> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qBinaryFind(const Container &container, const T &value) +QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qBinaryFind(const Container &container, const T &value) { return QAlgorithmsPrivate::qBinaryFindHelper(container.constBegin(), container.constEnd(), value, qLess<T>()); } @@ -340,7 +340,7 @@ namespace QAlgorithmsPrivate { #if QT_DEPRECATED_SINCE(5, 2) template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan) +QT_DEPRECATED_X("Use std::sort") Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan) { top: int span = int(end - start); @@ -393,13 +393,13 @@ top: } template <typename RandomAccessIterator, typename T> -QT_DEPRECATED inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy) +QT_DEPRECATED_X("Use std::sort") inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy) { qSortHelper(begin, end, dummy, qLess<T>()); } template <typename RandomAccessIterator> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qReverse(RandomAccessIterator begin, RandomAccessIterator end) +QT_DEPRECATED_X("Use std::reverse") Q_OUTOFLINE_TEMPLATE void qReverse(RandomAccessIterator begin, RandomAccessIterator end) { --end; while (begin < end) @@ -407,7 +407,7 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qReverse(RandomAccessIterator begin, Ran } template <typename RandomAccessIterator> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qRotate(RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end) +QT_DEPRECATED_X("Use std::rotate") Q_OUTOFLINE_TEMPLATE void qRotate(RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end) { qReverse(begin, middle); qReverse(middle, end); @@ -415,7 +415,7 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qRotate(RandomAccessIterator begin, Rand } template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qMerge(RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan) +QT_DEPRECATED_X("Use std::merge") Q_OUTOFLINE_TEMPLATE void qMerge(RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan) { const int len1 = pivot - begin; const int len2 = end - pivot; @@ -450,7 +450,7 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qMerge(RandomAccessIterator begin, Rando } template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &t, LessThan lessThan) +QT_DEPRECATED_X("Use std::stable_sort") Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &t, LessThan lessThan) { const int span = end - begin; if (span < 2) @@ -463,13 +463,13 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator b } template <typename RandomAccessIterator, typename T> -QT_DEPRECATED inline void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy) +QT_DEPRECATED_X("Use std::stable_sort") inline void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy) { qStableSortHelper(begin, end, dummy, qLess<T>()); } template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +QT_DEPRECATED_X("Use std::lower_bound") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) { RandomAccessIterator middle; int n = int(end - begin); @@ -490,7 +490,7 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(Random template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +QT_DEPRECATED_X("Use std::upper_bound") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) { RandomAccessIterator middle; int n = end - begin; @@ -510,7 +510,7 @@ QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(Random } template <typename RandomAccessIterator, typename T, typename LessThan> -QT_DEPRECATED Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) { RandomAccessIterator it = qLowerBoundHelper(begin, end, value, lessThan); diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp index 8e59000946..9a672a0505 100644 --- a/src/corelib/tools/qcollator_win.cpp +++ b/src/corelib/tools/qcollator_win.cpp @@ -125,9 +125,15 @@ int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) con // comparing strings, the value 2 can be subtracted from a nonzero return value. Then, the // meaning of <0, ==0, and >0 is consistent with the C runtime. +#ifndef Q_OS_WINRT return CompareString(LOCALE_USER_DEFAULT, d->collator, reinterpret_cast<const wchar_t*>(s1), len1, reinterpret_cast<const wchar_t*>(s2), len2) - 2; +#else // !Q_OS_WINRT + return CompareStringEx(LOCALE_NAME_USER_DEFAULT, d->collator, + reinterpret_cast<LPCWSTR>(s1), len1, + reinterpret_cast<LPCWSTR>(s2), len2, NULL, NULL, 0) - 2; +#endif // Q_OS_WINRT } int QCollator::compare(const QString &str1, const QString &str2) const @@ -142,13 +148,31 @@ int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const QCollatorSortKey QCollator::sortKey(const QString &string) const { +#ifndef Q_OS_WINRT int size = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY | d->collator, reinterpret_cast<const wchar_t*>(string.constData()), string.size(), 0, 0); +#elif defined(Q_OS_WINPHONE) + int size = 0; + Q_UNIMPLEMENTED(); +#else // Q_OS_WINPHONE + int size = LCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_SORTKEY | d->collator, + reinterpret_cast<LPCWSTR>(string.constData()), string.size(), + 0, 0, NULL, NULL, 0); +#endif // !Q_OS_WINPHONE QString ret(size, Qt::Uninitialized); +#ifndef Q_OS_WINRT int finalSize = LCMapStringW(LOCALE_USER_DEFAULT, LCMAP_SORTKEY | d->collator, reinterpret_cast<const wchar_t*>(string.constData()), string.size(), reinterpret_cast<wchar_t*>(ret.data()), ret.size()); +#elif defined(Q_OS_WINPHONE) + int finalSize = 0; +#else // Q_OS_WINPHONE + int finalSize = LCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_SORTKEY | d->collator, + reinterpret_cast<LPCWSTR>(string.constData()), string.size(), + reinterpret_cast<LPWSTR>(ret.data()), ret.size(), + NULL, NULL, 0); +#endif // !Q_OS_WINPHONE if (finalSize == 0) { qWarning() << "there were problems when generating the ::sortKey by LCMapStringW with error:" << GetLastError(); } diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 42721c018f..a95c7f53f7 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -61,6 +61,9 @@ # ifdef Q_OS_WINCE # include "qfunctions_wince.h" # endif +# ifdef Q_OS_WINRT +# include "qfunctions_winrt.h" +# endif #endif #if defined(Q_OS_MAC) diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp index 0730002ca3..bbc208e673 100644 --- a/src/corelib/tools/qlocale_win.cpp +++ b/src/corelib/tools/qlocale_win.cpp @@ -55,12 +55,32 @@ # include <time.h> #endif +#ifdef Q_OS_WINRT +#include <wrl.h> +#include <windows.foundation.h> +#include <windows.foundation.collections.h> +#ifndef Q_OS_WINPHONE +#include <windows.globalization.h> +#endif +#endif // Q_OS_WINRT + QT_BEGIN_NAMESPACE +#ifndef Q_OS_WINRT static QByteArray getWinLocaleName(LCID id = LOCALE_USER_DEFAULT); static const char *winLangCodeToIsoName(int code); static QString winIso639LangName(LCID id = LOCALE_USER_DEFAULT); static QString winIso3116CtryName(LCID id = LOCALE_USER_DEFAULT); +#else // !Q_OS_WINRT +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; + +static QByteArray getWinLocaleName(LPWSTR id = LOCALE_NAME_USER_DEFAULT); +static const char *winLangCodeToIsoName(int code); +static QString winIso639LangName(LPWSTR id = LOCALE_NAME_USER_DEFAULT); +static QString winIso3116CtryName(LPWSTR id = LOCALE_NAME_USER_DEFAULT); +#endif // Q_OS_WINRT #ifndef QT_NO_SYSTEMLOCALE @@ -121,14 +141,23 @@ private: }; // cached values: +#ifndef Q_OS_WINRT LCID lcid; +#else + WCHAR lcName[LOCALE_NAME_MAX_LENGTH]; +#endif SubstitutionType substitutionType; QChar zero; + int getLocaleInfo(LCTYPE type, LPWSTR data, int size); QString getLocaleInfo(LCTYPE type, int maxlen = 0); int getLocaleInfo_int(LCTYPE type, int maxlen = 0); QChar getLocaleInfo_qchar(LCTYPE type); + int getCurrencyFormat(DWORD flags, LPCWSTR value, const CURRENCYFMTW *format, LPWSTR data, int size); + int getDateFormat(DWORD flags, const SYSTEMTIME * date, LPCWSTR format, LPWSTR data, int size); + int getTimeFormat(DWORD flags, const SYSTEMTIME *date, LPCWSTR format, LPWSTR data, int size); + SubstitutionType substitution(); QString &substituteDigits(QString &string); @@ -140,20 +169,60 @@ Q_GLOBAL_STATIC(QSystemLocalePrivate, systemLocalePrivate) QSystemLocalePrivate::QSystemLocalePrivate() : substitutionType(SUnknown) { +#ifndef Q_OS_WINRT lcid = GetUserDefaultLCID(); +#else + GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH); +#endif +} + +inline int QSystemLocalePrivate::getCurrencyFormat(DWORD flags, LPCWSTR value, const CURRENCYFMTW *format, LPWSTR data, int size) +{ +#ifndef Q_OS_WINRT + return GetCurrencyFormat(lcid, flags, value, format, data, size); +#else + return GetCurrencyFormatEx(lcName, flags, value, format, data, size); +#endif +} + +inline int QSystemLocalePrivate::getDateFormat(DWORD flags, const SYSTEMTIME * date, LPCWSTR format, LPWSTR data, int size) +{ +#ifndef Q_OS_WINRT + return GetDateFormat(lcid, flags, date, format, data, size); +#else + return GetDateFormatEx(lcName, flags, date, format, data, size, NULL); +#endif +} + +inline int QSystemLocalePrivate::getTimeFormat(DWORD flags, const SYSTEMTIME *date, LPCWSTR format, LPWSTR data, int size) +{ +#ifndef Q_OS_WINRT + return GetTimeFormat(lcid, flags, date, format, data, size); +#else + return GetTimeFormatEx(lcName, flags, date, format, data, size); +#endif +} + +inline int QSystemLocalePrivate::getLocaleInfo(LCTYPE type, LPWSTR data, int size) +{ +#ifndef Q_OS_WINRT + return GetLocaleInfo(lcid, type, data, size); +#else + return GetLocaleInfoEx(lcName, type, data, size); +#endif } QString QSystemLocalePrivate::getLocaleInfo(LCTYPE type, int maxlen) { QVarLengthArray<wchar_t, 64> buf(maxlen ? maxlen : 64); - if (!GetLocaleInfo(lcid, type, buf.data(), buf.size())) + if (!getLocaleInfo(type, buf.data(), buf.size())) return QString(); if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - int cnt = GetLocaleInfo(lcid, type, 0, 0); + int cnt = getLocaleInfo(type, 0, 0); if (cnt == 0) return QString(); buf.resize(cnt); - if (!GetLocaleInfo(lcid, type, buf.data(), buf.size())) + if (!getLocaleInfo(type, buf.data(), buf.size())) return QString(); } return QString::fromWCharArray(buf.data()); @@ -177,7 +246,7 @@ QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution() { if (substitutionType == SUnknown) { wchar_t buf[8]; - if (!GetLocaleInfo(lcid, LOCALE_IDIGITSUBSTITUTION, buf, 8)) { + if (!getLocaleInfo(LOCALE_IDIGITSUBSTITUTION, buf, 8)) { substitutionType = QSystemLocalePrivate::SNever; return substitutionType; } @@ -189,7 +258,7 @@ QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution() substitutionType = QSystemLocalePrivate::SAlways; else { wchar_t digits[11]; - if (!GetLocaleInfo(lcid, LOCALE_SNATIVEDIGITS, digits, 11)) { + if (!getLocaleInfo(LOCALE_SNATIVEDIGITS, digits, 11)) { substitutionType = QSystemLocalePrivate::SNever; return substitutionType; } @@ -332,7 +401,7 @@ QVariant QSystemLocalePrivate::toString(const QDate &date, QLocale::FormatType t DWORD flags = (type == QLocale::LongFormat ? DATE_LONGDATE : DATE_SHORTDATE); wchar_t buf[255]; - if (GetDateFormat(lcid, flags, &st, NULL, buf, 255)) { + if (getDateFormat(flags, &st, NULL, buf, 255)) { QString format = QString::fromWCharArray(buf); if (substitution() == SAlways) substituteDigits(format); @@ -353,7 +422,7 @@ QVariant QSystemLocalePrivate::toString(const QTime &time, QLocale::FormatType) DWORD flags = 0; wchar_t buf[255]; - if (GetTimeFormat(lcid, flags, &st, NULL, buf, 255)) { + if (getTimeFormat(flags, &st, NULL, buf, 255)) { QString format = QString::fromWCharArray(buf); if (substitution() == SAlways) substituteDigits(format); @@ -371,7 +440,7 @@ QVariant QSystemLocalePrivate::measurementSystem() { wchar_t output[2]; - if (GetLocaleInfo(lcid, LOCALE_IMEASURE, output, 2)) { + if (getLocaleInfo(LOCALE_IMEASURE, output, 2)) { QString iMeasure = QString::fromWCharArray(output); if (iMeasure == QLatin1String("1")) { return QLocale::ImperialSystem; @@ -385,7 +454,7 @@ QVariant QSystemLocalePrivate::amText() { wchar_t output[15]; // maximum length including terminating zero character for Win2003+ - if (GetLocaleInfo(lcid, LOCALE_S1159, output, 15)) { + if (getLocaleInfo(LOCALE_S1159, output, 15)) { return QString::fromWCharArray(output); } @@ -396,7 +465,7 @@ QVariant QSystemLocalePrivate::pmText() { wchar_t output[15]; // maximum length including terminating zero character for Win2003+ - if (GetLocaleInfo(lcid, LOCALE_S2359, output, 15)) { + if (getLocaleInfo(LOCALE_S2359, output, 15)) { return QString::fromWCharArray(output); } @@ -407,7 +476,7 @@ QVariant QSystemLocalePrivate::firstDayOfWeek() { wchar_t output[4]; // maximum length including terminating zero character for Win2003+ - if (GetLocaleInfo(lcid, LOCALE_IFIRSTDAYOFWEEK, output, 4)) + if (getLocaleInfo(LOCALE_IFIRSTDAYOFWEEK, output, 4)) return QString::fromWCharArray(output).toUInt()+1; return 1; @@ -418,20 +487,20 @@ QVariant QSystemLocalePrivate::currencySymbol(QLocale::CurrencySymbolFormat form wchar_t buf[13]; switch (format) { case QLocale::CurrencySymbol: - if (GetLocaleInfo(lcid, LOCALE_SCURRENCY, buf, 13)) + if (getLocaleInfo(LOCALE_SCURRENCY, buf, 13)) return QString::fromWCharArray(buf); break; case QLocale::CurrencyIsoCode: - if (GetLocaleInfo(lcid, LOCALE_SINTLSYMBOL, buf, 9)) + if (getLocaleInfo(LOCALE_SINTLSYMBOL, buf, 9)) return QString::fromWCharArray(buf); break; case QLocale::CurrencyDisplayName: { QVarLengthArray<wchar_t, 64> buf(64); - if (!GetLocaleInfo(lcid, LOCALE_SNATIVECURRNAME, buf.data(), buf.size())) { + if (!getLocaleInfo(LOCALE_SNATIVECURRNAME, buf.data(), buf.size())) { if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) break; buf.resize(255); // should be large enough, right? - if (!GetLocaleInfo(lcid, LOCALE_SNATIVECURRNAME, buf.data(), buf.size())) + if (!getLocaleInfo(LOCALE_SNATIVECURRNAME, buf.data(), buf.size())) break; } return QString::fromWCharArray(buf.data()); @@ -478,14 +547,14 @@ QVariant QSystemLocalePrivate::toCurrencyString(const QSystemLocale::CurrencyToS CURRENCYFMT format; CURRENCYFMT *pformat = NULL; if (!arg.symbol.isEmpty()) { - format.NumDigits = getLocaleInfo_int(lcid, LOCALE_ICURRDIGITS); - format.LeadingZero = getLocaleInfo_int(lcid, LOCALE_ILZERO); - decimalSep = getLocaleInfo(lcid, LOCALE_SMONDECIMALSEP); + format.NumDigits = getLocaleInfo_int(LOCALE_ICURRDIGITS); + format.LeadingZero = getLocaleInfo_int(LOCALE_ILZERO); + decimalSep = getLocaleInfo(LOCALE_SMONDECIMALSEP); format.lpDecimalSep = (wchar_t *)decimalSep.utf16(); - thousandSep = getLocaleInfo(lcid, LOCALE_SMONTHOUSANDSEP); + thousandSep = getLocaleInfo(LOCALE_SMONTHOUSANDSEP); format.lpThousandSep = (wchar_t *)thousandSep.utf16(); - format.NegativeOrder = getLocaleInfo_int(lcid, LOCALE_INEGCURR); - format.PositiveOrder = getLocaleInfo_int(lcid, LOCALE_ICURRENCY); + format.NegativeOrder = getLocaleInfo_int(LOCALE_INEGCURR); + format.PositiveOrder = getLocaleInfo_int(LOCALE_ICURRENCY); format.lpCurrencySymbol = (wchar_t *)arg.symbol.utf16(); // grouping is complicated and ugly: @@ -494,7 +563,7 @@ QVariant QSystemLocalePrivate::toCurrencyString(const QSystemLocale::CurrencyToS // int(30) == "123456,789.00" == string("3;0;0") // int(32) == "12,34,56,789.00" == string("3;2;0") // int(320)== "1234,56,789.00" == string("3;2") - QString groupingStr = getLocaleInfo(lcid, LOCALE_SMONGROUPING); + QString groupingStr = getLocaleInfo(LOCALE_SMONGROUPING); format.Grouping = groupingStr.remove(QLatin1Char(';')).toInt(); if (format.Grouping % 10 == 0) // magic format.Grouping /= 10; @@ -503,13 +572,13 @@ QVariant QSystemLocalePrivate::toCurrencyString(const QSystemLocale::CurrencyToS pformat = &format; } - int ret = ::GetCurrencyFormat(lcid, 0, reinterpret_cast<const wchar_t *>(value.utf16()), + int ret = getCurrencyFormat(0, reinterpret_cast<const wchar_t *>(value.utf16()), pformat, out.data(), out.size()); if (ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - ret = ::GetCurrencyFormat(lcid, 0, reinterpret_cast<const wchar_t *>(value.utf16()), + ret = getCurrencyFormat(0, reinterpret_cast<const wchar_t *>(value.utf16()), pformat, out.data(), 0); out.resize(ret); - ::GetCurrencyFormat(lcid, 0, reinterpret_cast<const wchar_t *>(value.utf16()), + getCurrencyFormat(0, reinterpret_cast<const wchar_t *>(value.utf16()), pformat, out.data(), out.size()); } @@ -528,11 +597,13 @@ QVariant QSystemLocalePrivate::uiLanguages() PWSTR pwszLanguagesBuffer, PULONG pcchLanguagesBuffer); static GetUserPreferredUILanguagesFunc GetUserPreferredUILanguages_ptr = 0; +#ifndef Q_OS_WINRT if (!GetUserPreferredUILanguages_ptr) { QSystemLibrary lib(QLatin1String("kernel32")); if (lib.load()) GetUserPreferredUILanguages_ptr = (GetUserPreferredUILanguagesFunc)lib.resolve("GetUserPreferredUILanguages"); } +#endif // !Q_OS_WINRT if (GetUserPreferredUILanguages_ptr) { unsigned long cnt = 0; QVarLengthArray<wchar_t, 64> buf(64); @@ -560,8 +631,39 @@ QVariant QSystemLocalePrivate::uiLanguages() } } +#ifndef Q_OS_WINRT // old Windows before Vista return QStringList(QString::fromLatin1(winLangCodeToIsoName(GetUserDefaultUILanguage()))); +#else // !Q_OS_WINRT + QStringList result; +#ifndef Q_OS_WINPHONE + ComPtr<ABI::Windows::Globalization::IApplicationLanguagesStatics> appLanguagesStatics; + if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Globalization_ApplicationLanguages).Get(), &appLanguagesStatics))) { + qWarning("Could not obtain ApplicationLanguagesStatic"); + return QStringList(); + } + + ComPtr<ABI::Windows::Foundation::Collections::IVectorView<HSTRING> > languageList; + appLanguagesStatics->get_ManifestLanguages(&languageList); + + if (!languageList) + return QStringList(); + + unsigned int size; + languageList->get_Size(&size); + for (unsigned int i = 0; i < size; ++i) { + HSTRING language; + languageList->GetAt(i, &language); + UINT32 length; + PCWSTR rawString = WindowsGetStringRawBuffer(language, &length); + result << QString::fromWCharArray(rawString, length); + } +#else // !Q_OS_WINPHONE + result << QString::fromWCharArray(lcName); +#endif // Q_OS_WINPHONE + + return result; +#endif // Q_OS_WINRT } QVariant QSystemLocalePrivate::nativeLanguageName() @@ -581,7 +683,11 @@ QVariant QSystemLocalePrivate::nativeCountryName() void QSystemLocalePrivate::update() { +#ifndef Q_OS_WINRT lcid = GetUserDefaultLCID(); +#else + GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH); +#endif substitutionType = SUnknown; zero = QChar(); } @@ -895,7 +1001,11 @@ static const char *winLangCodeToIsoName(int code) } +#ifndef Q_OS_WINRT static QString winIso639LangName(LCID id) +#else +static QString winIso639LangName(LPWSTR id) +#endif { QString result; @@ -903,7 +1013,11 @@ static QString winIso639LangName(LCID id) // the language code QString lang_code; wchar_t out[256]; - if (GetLocaleInfo(id, LOCALE_ILANGUAGE, out, 255)) // ### shouldn't use them according to msdn +#ifndef Q_OS_WINRT + if (GetLocaleInfo(id, LOCALE_ILANGUAGE, out, 255)) +#else + if (GetLocaleInfoEx(id, LOCALE_ILANGUAGE, out, 255)) +#endif lang_code = QString::fromWCharArray(out); if (!lang_code.isEmpty()) { @@ -926,27 +1040,47 @@ static QString winIso639LangName(LCID id) return result; // not one of the problematic languages - do the usual lookup - if (GetLocaleInfo(id, LOCALE_SISO639LANGNAME , out, 255)) +#ifndef Q_OS_WINRT + if (GetLocaleInfo(id, LOCALE_SISO639LANGNAME, out, 255)) +#else + if (GetLocaleInfoEx(id, LOCALE_SISO639LANGNAME, out, 255)) +#endif result = QString::fromWCharArray(out); return result; } +#ifndef Q_OS_WINRT static QString winIso3116CtryName(LCID id) +#else +static QString winIso3116CtryName(LPWSTR id) +#endif { QString result; wchar_t out[256]; +#ifndef Q_OS_WINRT if (GetLocaleInfo(id, LOCALE_SISO3166CTRYNAME, out, 255)) +#else + if (GetLocaleInfoEx(id, LOCALE_SISO3166CTRYNAME, out, 255)) +#endif result = QString::fromWCharArray(out); return result; } +#ifndef Q_OS_WINRT static QByteArray getWinLocaleName(LCID id) +#else +static QByteArray getWinLocaleName(LPWSTR id) +#endif { QByteArray result; +#ifndef Q_OS_WINRT if (id == LOCALE_USER_DEFAULT) { +#else + if (QString::fromWCharArray(id) == QString::fromWCharArray(LOCALE_NAME_USER_DEFAULT)) { +#endif static QByteArray langEnvVar = qgetenv("LANG"); result = langEnvVar; QString lang, script, cntry; @@ -964,9 +1098,17 @@ static QByteArray getWinLocaleName(LCID id) #if defined(Q_OS_WINCE) result = winLangCodeToIsoName(id != LOCALE_USER_DEFAULT ? id : GetUserDefaultLCID()); -#else +#else // !Q_OS_WINCE +# ifndef Q_OS_WINRT if (id == LOCALE_USER_DEFAULT) id = GetUserDefaultLCID(); +# else // !Q_OS_WINRT + WCHAR lcName[LOCALE_NAME_MAX_LENGTH]; + if (QString::fromWCharArray(id) == QString::fromWCharArray(LOCALE_NAME_USER_DEFAULT)) { + GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH); + id = lcName; + } +# endif // Q_OS_WINRT QString resultuage = winIso639LangName(id); QString country = winIso3116CtryName(id); result = resultuage.toLatin1(); @@ -974,14 +1116,20 @@ static QByteArray getWinLocaleName(LCID id) result += '_'; result += country.toLatin1(); } -#endif +#endif // !Q_OS_WINCE return result; } Q_CORE_EXPORT QLocale qt_localeFromLCID(LCID id) { +#ifndef Q_OS_WINRT return QLocale(QString::fromLatin1(getWinLocaleName(id))); +#else // !Q_OS_WINRT + WCHAR name[LOCALE_NAME_MAX_LENGTH]; + LCIDToLocaleName(id, name, LOCALE_NAME_MAX_LENGTH, 0); + return QLocale(QString::fromLatin1(getWinLocaleName(name))); +#endif // Q_OS_WINRT } QT_END_NAMESPACE diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3976f2cb6f..77d002e4d5 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3158,6 +3158,15 @@ int QString::count(const QStringRef &str, Qt::CaseSensitivity cs) const \sa indexOf(), count() */ +/*! \fn bool QString::contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const + \since 5.3 + + \overload contains() + + Returns \c true if this string contains an occurrence of the latin-1 string + \a str; otherwise returns \c false. +*/ + /*! \fn bool QString::contains(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const \overload contains() @@ -5109,7 +5118,11 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1, return ucstrcmp(data1, length1, data2, length2); #if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) +#ifndef Q_OS_WINRT int res = CompareString(GetUserDefaultLCID(), 0, (wchar_t*)data1, length1, (wchar_t*)data2, length2); +#else + int res = CompareStringEx(LOCALE_NAME_USER_DEFAULT, 0, (LPCWSTR)data1, length1, (LPCWSTR)data2, length2, NULL, NULL, 0); +#endif switch (res) { case CSTR_LESS_THAN: diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 3140af084b..798ff2f3e0 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -332,6 +332,7 @@ public: inline bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; inline bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + inline bool contains(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; inline bool contains(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; @@ -985,6 +986,8 @@ inline bool QString::contains(const QString &s, Qt::CaseSensitivity cs) const { return indexOf(s, 0, cs) != -1; } inline bool QString::contains(const QStringRef &s, Qt::CaseSensitivity cs) const { return indexOf(s, 0, cs) != -1; } +inline bool QString::contains(QLatin1String s, Qt::CaseSensitivity cs) const +{ return indexOf(s, 0, cs) != -1; } inline bool QString::contains(QChar c, Qt::CaseSensitivity cs) const { return indexOf(c, 0, cs) != -1; } diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp index 5fec06b30a..24c20b46c7 100644 --- a/src/corelib/tools/qtimezone.cpp +++ b/src/corelib/tools/qtimezone.cpp @@ -65,7 +65,8 @@ static QTimeZonePrivate *newBackendTimeZone() return new QMacTimeZonePrivate(); #elif defined Q_OS_UNIX return new QTzTimeZonePrivate(); -#elif defined Q_OS_WIN + // Registry based timezone backend not available on WinRT +#elif defined Q_OS_WIN && !defined Q_OS_WINRT return new QWinTimeZonePrivate(); #elif defined QT_USE_ICU return new QIcuTimeZonePrivate(); @@ -89,7 +90,8 @@ static QTimeZonePrivate *newBackendTimeZone(const QByteArray &olsenId) return new QMacTimeZonePrivate(olsenId); #elif defined Q_OS_UNIX return new QTzTimeZonePrivate(olsenId); -#elif defined Q_OS_WIN + // Registry based timezone backend not available on WinRT +#elif defined Q_OS_WIN && !defined Q_OS_WINRT return new QWinTimeZonePrivate(olsenId); #elif defined QT_USE_ICU return new QIcuTimeZonePrivate(olsenId); diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index e4a7b02aee..5de2364fe2 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -125,8 +125,11 @@ else:blackberry { HEADERS += tools/qlocale_blackberry.h } else:unix:SOURCES += tools/qelapsedtimer_unix.cpp tools/qlocale_unix.cpp tools/qtimezoneprivate_tz.cpp -else:win32:SOURCES += tools/qelapsedtimer_win.cpp tools/qlocale_win.cpp tools/qtimezoneprivate_win.cpp -else:integrity:SOURCES += tools/qelapsedtimer_unix.cpp tools/qlocale_unix.cpp +else:win32 { + SOURCES += tools/qelapsedtimer_win.cpp tools/qlocale_win.cpp + !winrt: SOURCES += tools/qtimezoneprivate_win.cpp + winphone: LIBS_PRIVATE += -lWindowsPhoneGlobalizationUtil +} else:integrity:SOURCES += tools/qelapsedtimer_unix.cpp tools/qlocale_unix.cpp else:SOURCES += tools/qelapsedtimer_generic.cpp contains(QT_CONFIG, zlib) { |