Browse Source

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

adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
d060b0d342
  1. 14
      src/base/utils/string.cpp

14
src/base/utils/string.cpp

@ -51,8 +51,13 @@ namespace @@ -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 @@ -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);

Loading…
Cancel
Save