void KFileItemModel::prepareItemsForSorting(QList<ItemData*>& itemDataList)
{
switch (m_sortRole) {
+ case ExtensionRole:
case PermissionsRole:
case OwnerRole:
case GroupRole:
data.insert(sharedValue("text"), item.text());
}
+ if (m_requestRole[ExtensionRole]) {
+ data.insert(sharedValue("extension"), QFileInfo(item.name()).suffix());
+ }
+
if (m_requestRole[SizeRole] && !isDir) {
data.insert(sharedValue("size"), item.size());
}
{ nullptr, NoRole, KLazyLocalizedString(), KLazyLocalizedString(), false, false },
{ "text", NameRole, kli18nc("@label", "Name"), KLazyLocalizedString(), false, false },
{ "size", SizeRole, kli18nc("@label", "Size"), KLazyLocalizedString(), false, false },
- { "modificationtime", ModificationTimeRole, kli18nc("@label", "Modified"), KLazyLocalizedString(), false, false },
- { "creationtime", CreationTimeRole, kli18nc("@label", "Created"), KLazyLocalizedString(), false, false },
- { "accesstime", AccessTimeRole, kli18nc("@label", "Accessed"), KLazyLocalizedString(), false, false },
{ "type", TypeRole, kli18nc("@label", "Type"), KLazyLocalizedString(), false, false },
+ { "extension", ExtensionRole, kli18nc("@label", "Extension"), KLazyLocalizedString(), false, false },
{ "rating", RatingRole, kli18nc("@label", "Rating"), KLazyLocalizedString(), true, false },
{ "tags", TagsRole, kli18nc("@label", "Tags"), KLazyLocalizedString(), true, false },
{ "comment", CommentRole, kli18nc("@label", "Comment"), KLazyLocalizedString(), true, false },
+ { "modificationtime", ModificationTimeRole, kli18nc("@label", "Modified"), kli18nc("@label", "Date"), false, false },
+ { "creationtime", CreationTimeRole, kli18nc("@label", "Created"), kli18nc("@label", "Date"), false, false },
+ { "accesstime", AccessTimeRole, kli18nc("@label", "Accessed"), kli18nc("@label", "Date"), false, false },
{ "title", TitleRole, kli18nc("@label", "Title"), kli18nc("@label", "Document"), true, true },
+ { "author", AuthorRole, kli18nc("@label", "Author"), kli18nc("@label", "Document"), true, true },
{ "wordCount", WordCountRole, kli18nc("@label", "Word Count"), kli18nc("@label", "Document"), true, true },
{ "lineCount", LineCountRole, kli18nc("@label", "Line Count"), kli18nc("@label", "Document"), true, true },
{ "imageDateTime", ImageDateTimeRole, kli18nc("@label", "Date Photographed"), kli18nc("@label", "Image"), true, true },