mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Fix natural sorting when the common part of 2 strings ends partially in a number which continues in the uncommon part.
Closes #8080 #6732.
This commit is contained in:
@@ -85,7 +85,10 @@ namespace
|
|||||||
|
|
||||||
const QChar leftChar = (m_caseSensitivity == Qt::CaseSensitive) ? left[posL] : left[posL].toLower();
|
const QChar leftChar = (m_caseSensitivity == Qt::CaseSensitive) ? left[posL] : left[posL].toLower();
|
||||||
const QChar rightChar = (m_caseSensitivity == Qt::CaseSensitive) ? right[posR] : right[posR].toLower();
|
const QChar rightChar = (m_caseSensitivity == Qt::CaseSensitive) ? right[posR] : right[posR].toLower();
|
||||||
if (leftChar == rightChar) {
|
// Compare only non-digits.
|
||||||
|
// Numbers should be compared as a whole
|
||||||
|
// otherwise the string->int conversion can yield a wrong value
|
||||||
|
if ((leftChar == rightChar) && !leftChar.isDigit()) {
|
||||||
// compare next character
|
// compare next character
|
||||||
++posL;
|
++posL;
|
||||||
++posR;
|
++posR;
|
||||||
|
|||||||
Reference in New Issue
Block a user