Commit 2d008a5b authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Folder View] Compare UDS entry times directly instead of going through KFileItem

This avoids creating a QDateTime object with all the timezone processing that comes with it since we're only interested
in the relative order, not absolute precise date time values.

CHANGELOG: Sorting files by date in Folder View is significantly faster now

Differential Revision:
parent b8bad291
......@@ -1437,8 +1437,8 @@ bool FolderModel::lessThan(const QModelIndex &left, const QModelIndex &right) co
case KDirModel::ModifiedTime: {
const QDateTime leftTime = leftItem.time(KFileItem::ModificationTime);
const QDateTime rightTime = rightItem.time(KFileItem::ModificationTime);
const long long leftTime = leftItem.entry().numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME, -1);
const long long rightTime = rightItem.entry().numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME, -1);
if (leftTime < rightTime)
result = -1;
else if (leftTime > rightTime)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment