diff options
| author | Elvis Angelaccio <[email protected]> | 2020-10-15 00:07:12 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2020-10-15 01:22:00 +0200 |
| commit | 1ded75ce44f2644d054a8c0f0aa0418d4c83742e (patch) | |
| tree | fb30f7b51c6cb707b53b55304f106ec1d36cc1c4 /src/kitemviews | |
| parent | d9956c620eb38baa6e534eb14a8d376ea07ed8c6 (diff) | |
Stop using QVariant < operator
It will be removed in Qt 6 without porting strategy:
https://github.com/qt/qtbase/commit/f43cb31ba00a431c6d0a0b17750483a72ae03bb0
We know that that variants will be either ints (for `count`) or longs (for `size`),
so just convert them to longs (to avoid overflows) and compare those.
Diffstat (limited to 'src/kitemviews')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index a3a2bef32..0b7a5134c 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -1771,7 +1771,7 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const } else if (valueB.isNull()) { result = +1; } else { - if (valueA < valueB) { + if (valueA.toLongLong() < valueB.toLongLong()) { return -1; } else { return +1; |
