From 1ded75ce44f2644d054a8c0f0aa0418d4c83742e Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Thu, 15 Oct 2020 00:07:12 +0200 Subject: [PATCH] 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. --- src/kitemviews/kfileitemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3