Browse Source

Merge pull request #3918 from glassez/winfix

Fix compilation on Windows.
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
4a271d358f
  1. 4
      src/core/utils/string.cpp

4
src/core/utils/string.cpp

@ -111,7 +111,7 @@ Utils::String::NaturalCompare::NaturalCompare()
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
// Without ICU library, QCollator doesn't support `setNumericMode(true)` on OS older than Win7 // Without ICU library, QCollator doesn't support `setNumericMode(true)` on OS older than Win7
if(SysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7) if(QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
return; return;
#endif #endif
m_collator.setNumericMode(true); m_collator.setNumericMode(true);
@ -124,7 +124,7 @@ bool Utils::String::NaturalCompare::operator()(const QString &l, const QString &
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
// Without ICU library, QCollator doesn't support `setNumericMode(true)` on OS older than Win7 // Without ICU library, QCollator doesn't support `setNumericMode(true)` on OS older than Win7
if(SysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7) if(QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
return lessThan(l, r); return lessThan(l, r);
#endif #endif
return (m_collator.compare(l, r) < 0); return (m_collator.compare(l, r) < 0);

Loading…
Cancel
Save