Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kfileitemmodel.cpp
Show First 20 Lines • Show All 1557 Lines • ▼ Show 20 Line(s) | 1557 | if (m_requestRole[NameRole]) { | |||
---|---|---|---|---|---|
1558 | data.insert(sharedValue("text"), item.text()); | 1558 | data.insert(sharedValue("text"), item.text()); | ||
1559 | } | 1559 | } | ||
1560 | 1560 | | |||
1561 | if (m_requestRole[SizeRole] && !isDir) { | 1561 | if (m_requestRole[SizeRole] && !isDir) { | ||
1562 | data.insert(sharedValue("size"), item.size()); | 1562 | data.insert(sharedValue("size"), item.size()); | ||
1563 | } | 1563 | } | ||
1564 | 1564 | | |||
1565 | if (m_requestRole[ModificationTimeRole]) { | 1565 | if (m_requestRole[ModificationTimeRole]) { | ||
1566 | // Don't use KFileItem::timeString() as this is too expensive when | 1566 | // Don't use KFileItem::timeString() or KFileItem::time() as this is too expensive when | ||
1567 | // having several thousands of items. Instead the formatting of the | 1567 | // having several thousands of items. Instead read the raw number from UDSEntry directly | ||
1568 | // date-time will be done on-demand by the view when the date will be shown. | 1568 | // and the formatting of the date-time will be done on-demand by the view when the date will be shown. | ||
1569 | const QDateTime dateTime = item.time(KFileItem::ModificationTime); | 1569 | const long long dateTime = item.entry().numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME, -1); | ||
1570 | data.insert(sharedValue("modificationtime"), dateTime); | 1570 | data.insert(sharedValue("modificationtime"), dateTime); | ||
1571 | } | 1571 | } | ||
1572 | 1572 | | |||
1573 | if (m_requestRole[CreationTimeRole]) { | 1573 | if (m_requestRole[CreationTimeRole]) { | ||
1574 | // Don't use KFileItem::timeString() as this is too expensive when | 1574 | // Don't use KFileItem::timeString() or KFileItem::time() as this is too expensive when | ||
1575 | // having several thousands of items. Instead the formatting of the | 1575 | // having several thousands of items. Instead read the raw number from UDSEntry directly | ||
1576 | // date-time will be done on-demand by the view when the date will be shown. | 1576 | // and the formatting of the date-time will be done on-demand by the view when the date will be shown. | ||
1577 | const QDateTime dateTime = item.time(KFileItem::CreationTime); | 1577 | const long long dateTime = item.entry().numberValue(KIO::UDSEntry::UDS_CREATION_TIME, -1); | ||
1578 | data.insert(sharedValue("creationtime"), dateTime); | 1578 | data.insert(sharedValue("creationtime"), dateTime); | ||
1579 | } | 1579 | } | ||
1580 | 1580 | | |||
1581 | if (m_requestRole[AccessTimeRole]) { | 1581 | if (m_requestRole[AccessTimeRole]) { | ||
1582 | // Don't use KFileItem::timeString() as this is too expensive when | 1582 | // Don't use KFileItem::timeString() or KFileItem::time() as this is too expensive when | ||
1583 | // having several thousands of items. Instead the formatting of the | 1583 | // having several thousands of items. Instead read the raw number from UDSEntry directly | ||
1584 | // date-time will be done on-demand by the view when the date will be shown. | 1584 | // and the formatting of the date-time will be done on-demand by the view when the date will be shown. | ||
1585 | const QDateTime dateTime = item.time(KFileItem::AccessTime); | 1585 | const long long dateTime = item.entry().numberValue(KIO::UDSEntry::UDS_ACCESS_TIME, -1); | ||
1586 | data.insert(sharedValue("accesstime"), dateTime); | 1586 | data.insert(sharedValue("accesstime"), dateTime); | ||
1587 | } | 1587 | } | ||
1588 | 1588 | | |||
1589 | if (m_requestRole[PermissionsRole]) { | 1589 | if (m_requestRole[PermissionsRole]) { | ||
1590 | data.insert(sharedValue("permissions"), item.permissionsString()); | 1590 | data.insert(sharedValue("permissions"), item.permissionsString()); | ||
1591 | } | 1591 | } | ||
1592 | 1592 | | |||
1593 | if (m_requestRole[OwnerRole]) { | 1593 | if (m_requestRole[OwnerRole]) { | ||
▲ Show 20 Lines • Show All 782 Lines • Show Last 20 Lines |