diff --git a/src/gui/transferlistsortmodel.cpp b/src/gui/transferlistsortmodel.cpp
index 69ecb3eaa..0549ff85c 100644
--- a/src/gui/transferlistsortmodel.cpp
+++ b/src/gui/transferlistsortmodel.cpp
@@ -183,13 +183,13 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex
         }
 
     case TransferListModel::TR_LAST_ACTIVITY: {
-            const qlonglong vL = left.data().toLongLong();
-            const qlonglong vR = right.data().toLongLong();
+            const int vL = left.data().toInt();
+            const int vR = right.data().toInt();
 
-            if (vL == -1) return false;
-            if (vR == -1) return true;
+            if (vL < 0) return false;
+            if (vR < 0) return true;
 
-            return vL < vR;
+            return (vL < vR);
         }
 
     case TransferListModel::TR_RATIO_LIMIT: {
