Commit 573abcaf authored by Méven Car's avatar Méven Car Committed by Méven Car
Browse files

kfileitemmodel: sortRoleCompare: allow to sort by access time.

We had all sorts of weird behavior when sorting by access time.
The comparison was simply missing in sortRoleCompare.
parent 7b48a8b6
Pipeline #183606 passed with stage
in 9 minutes and 19 seconds
......@@ -2067,6 +2067,17 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const
break;
}
case AccessTimeRole: {
const long long dateTimeA = itemA.entry().numberValue(KIO::UDSEntry::UDS_ACCESS_TIME, -1);
const long long dateTimeB = itemB.entry().numberValue(KIO::UDSEntry::UDS_ACCESS_TIME, -1);
if (dateTimeA < dateTimeB) {
return -1;
} else if (dateTimeA > dateTimeB) {
return +1;
}
break;
}
case CreationTimeRole: {
const long long dateTimeA = itemA.entry().numberValue(KIO::UDSEntry::UDS_CREATION_TIME, -1);
const long long dateTimeB = itemB.entry().numberValue(KIO::UDSEntry::UDS_CREATION_TIME, -1);
......
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