Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

[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: https://phabricator.kde.org/D15291
parent b8bad291
......@@ -1437,8 +1437,8 @@ bool FolderModel::lessThan(const QModelIndex &left, const QModelIndex &right) co
break;
}
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)
......
Markdown is supported
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