mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
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.
This commit is contained in:
parent
7b48a8b6e4
commit
573abcaf25
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue