]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Add Page count and Publisher columns
authorSerg Podtynnyi <serg@podtynnyi.com>
Sat, 4 Feb 2023 14:57:38 +0000 (21:57 +0700)
committerSerg Podtynnyi <serg@podtynnyi.com>
Sat, 4 Feb 2023 15:14:46 +0000 (22:14 +0700)
BUG: 374561

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

index c08f8e964b3cd9e34532d6f92df1d2aeba9f2f8e..5e6f9af01b638d0666eacc6d4d94c94a9a126123 100644 (file)
@@ -2118,6 +2118,8 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const
     case RatingRole:
     case WidthRole:
     case HeightRole:
+    case PublisherRole:
+    case PageCountRole:
     case WordCountRole:
     case LineCountRole:
     case TrackRole:
@@ -2644,6 +2646,8 @@ const KFileItemModel::RoleInfoMap* KFileItemModel::rolesInfoMap(int& count)
         { "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  },
+        { "publisher",           PublisherRole,           kli18nc("@label", "Publisher"),            kli18nc("@label", "Document"),                     true,            true  },
+        { "pageCount",           PageCountRole,           kli18nc("@label", "Page Count"),           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 74aec17a943dabf855613afef4b30bd76489778d..368ab76d8830225b232ec040d35fd43a709be31e 100644 (file)
@@ -298,7 +298,7 @@ private:
         GroupRole, TypeRole, ExtensionRole, DestinationRole, PathRole, DeletionTimeRole,
         // User visible roles available with Baloo:
         CommentRole, TagsRole, RatingRole, DimensionsRole, WidthRole, HeightRole, ImageDateTimeRole, OrientationRole,
-        WordCountRole, TitleRole, AuthorRole, LineCountRole, ArtistRole, GenreRole, AlbumRole, DurationRole, TrackRole, ReleaseYearRole,
+        PublisherRole, PageCountRole, WordCountRole, TitleRole, AuthorRole, LineCountRole, ArtistRole, GenreRole, AlbumRole, DurationRole, TrackRole, ReleaseYearRole,
         BitrateRole, OriginUrlRole, AspectRatioRole, FrameRateRole,
         // Non-visible roles:
         IsDirRole, IsLinkRole, IsHiddenRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
index dd6df0aa77dbfc466426b4374ef97923298604f6..f6d4dddb7288620b4389d3e8628933632c91a010 100644 (file)
@@ -36,6 +36,8 @@ namespace {
             { Property::Comment,           QByteArrayLiteral("comment") },
             { Property::Title,             QByteArrayLiteral("title") },
             { Property::Author,            QByteArrayLiteral("author") },
+            { Property::Publisher,         QByteArrayLiteral("publisher") },
+            { Property::PageCount,         QByteArrayLiteral("pageCount") },
             { Property::WordCount,         QByteArrayLiteral("wordCount") },
             { Property::LineCount,         QByteArrayLiteral("lineCount") },
             { Property::Width,             QByteArrayLiteral("width") },