mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 20:58:07 -06:00
Simplify sorting code.
This commit is contained in:
@@ -113,17 +113,11 @@ bool SearchSortModel::lessThan(const QModelIndex &left, const QModelIndex &right
|
||||
const QString strL = left.data().toString();
|
||||
const QString strR = right.data().toString();
|
||||
const int result = Utils::String::naturalCompare(strL, strR, Qt::CaseInsensitive);
|
||||
if (result != 0)
|
||||
return (result < 0);
|
||||
|
||||
return (left < right);
|
||||
}
|
||||
return (result < 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (left.data() != right.data())
|
||||
return base::lessThan(left, right);
|
||||
|
||||
return (left < right);
|
||||
return base::lessThan(left, right);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user