]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Add additional Document role for "Author"
authorKai Uwe Broulik <kde@privat.broulik.de>
Tue, 19 Apr 2022 19:31:53 +0000 (21:31 +0200)
committerKai Uwe Broulik <kde@privat.broulik.de>
Tue, 19 Apr 2022 19:33:34 +0000 (21:33 +0200)
It comes in handy when organizing your books collection

src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodel.h
src/kitemviews/private/kbaloorolesprovider.cpp

index 052a71cbd4863020469da79c89adba18fe952a99..c58c2ee79206aea46ab51c735e5ab15b69cb89b6 100644 (file)
@@ -2613,6 +2613,7 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count)
         { "tags",                TagsRole,                kli18nc("@label", "Tags"),                 KLazyLocalizedString(),                            true,            false },
         { "comment",             CommentRole,             kli18nc("@label", "Comment"),              KLazyLocalizedString(),                            true,            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  },
index cc39a0084d21246f3aff0d8dd143c463424b74b4..f82e91d493cde5d4ae551d63b95cabef246a0689 100644 (file)
@@ -293,7 +293,7 @@ private:
         GroupRole, TypeRole, DestinationRole, PathRole, DeletionTimeRole,
         // User visible roles available with Baloo:
         CommentRole, TagsRole, RatingRole, DimensionsRole, WidthRole, HeightRole, ImageDateTimeRole, OrientationRole,
-        WordCountRole, TitleRole, LineCountRole, ArtistRole, GenreRole, AlbumRole, DurationRole, TrackRole, ReleaseYearRole,
+        WordCountRole, TitleRole, AuthorRole, LineCountRole, ArtistRole, GenreRole, AlbumRole, DurationRole, TrackRole, ReleaseYearRole,
         BitrateRole, OriginUrlRole, AspectRatioRole, FrameRateRole,
         // Non-visible roles:
         IsDirRole, IsLinkRole, IsHiddenRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
index 4c231e2ff92ddf45f320c8359068057c19b526f6..e183a0f9a20719ae14d1a59cabc0680e308d5c8a 100644 (file)
@@ -37,6 +37,7 @@ namespace {
             { Property::Rating,            QByteArrayLiteral("rating") },
             { Property::Comment,           QByteArrayLiteral("comment") },
             { Property::Title,             QByteArrayLiteral("title") },
+            { Property::Author,            QByteArrayLiteral("author") },
             { Property::WordCount,         QByteArrayLiteral("wordCount") },
             { Property::LineCount,         QByteArrayLiteral("lineCount") },
             { Property::Width,             QByteArrayLiteral("width") },