Don't use QCollator for sorting on Windows. Closes #5238 and #5240.

This commit is contained in:
sledgehammer999 2016-06-08 22:53:59 +03:00
parent 39a81f30ff
commit d060b0d342

View file

@ -51,8 +51,13 @@ namespace
{
#ifdef QBT_USES_QT5
#if defined(Q_OS_WIN)
// Without ICU library, QCollator uses the native API on Windows 7+. But that API
// sorts older versions of μTorrent differently than the newer ones because the
// 'μ' character is encoded differently and the native API can't cope with that.
// So default to using our custom natural sorting algorithm instead.
// See #5238 and #5240
// Without ICU library, QCollator doesn't support `setNumericMode(true)` on OS older than Win7
if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
// if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
return;
#endif
m_collator.setNumericMode(true);
@ -64,8 +69,13 @@ namespace
{
#ifdef QBT_USES_QT5
#if defined(Q_OS_WIN)
// Without ICU library, QCollator uses the native API on Windows 7+. But that API
// sorts older versions of μTorrent differently than the newer ones because the
// 'μ' character is encoded differently and the native API can't cope with that.
// So default to using our custom natural sorting algorithm instead.
// See #5238 and #5240
// Without ICU library, QCollator doesn't support `setNumericMode(true)` on OS older than Win7
if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
// if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
return lessThan(left, right);
#endif
return (m_collator.compare(left, right) < 0);