diff options
Diffstat (limited to 'src/kitemviews')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 4 | ||||
| -rw-r--r-- | src/kitemviews/kfileitemmodel.h | 4 | ||||
| -rw-r--r-- | src/kitemviews/private/kbaloorolesprovider.cpp | 51 |
3 files changed, 37 insertions, 22 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index e4ac1dba0..7df01112a 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -2833,9 +2833,13 @@ const KFileItemModel::RoleInfoMap *KFileItemModel::rolesInfoMap(int &count) { "bitrate", BitrateRole, kli18nc("@label", "Bitrate"), kli18nc("@label", "Audio"), KLazyLocalizedString(), true, true }, { "track", TrackRole, kli18nc("@label", "Track"), kli18nc("@label", "Audio"), KLazyLocalizedString(), true, true }, { "releaseYear", ReleaseYearRole, kli18nc("@label", "Release Year"), kli18nc("@label", "Audio"), KLazyLocalizedString(), true, true }, + { "audioCodec", AudioCodecRole, kli18nc("@label", "Audio Codec"), kli18nc("@label", "Audio"), KLazyLocalizedString(), true, true }, { "aspectRatio", AspectRatioRole, kli18nc("@label", "Aspect Ratio"), kli18nc("@label", "Video"), KLazyLocalizedString(), true, true }, { "frameRate", FrameRateRole, kli18nc("@label", "Frame Rate"), kli18nc("@label", "Video"), KLazyLocalizedString(), true, true }, { "duration", DurationRole, kli18nc("@label", "Duration"), kli18nc("@label", "Video"), KLazyLocalizedString(), true, true }, + { "videoCodec", VideoCodecRole, kli18nc("@label", "Video Codec"), kli18nc("@label", "Video"), KLazyLocalizedString(), true, true }, + { "pixelFormat", PixelFormatRole, kli18nc("@label", "Pixel Format"), kli18nc("@label", "Video"), KLazyLocalizedString(), true, true }, + { "colorSpace", ColorSpaceRole, kli18nc("@label", "Color Space"), kli18nc("@label", "Video"), KLazyLocalizedString(), true, true }, { "path", PathRole, kli18nc("@label", "Path"), kli18nc("@label", "Other"), KLazyLocalizedString(), false, false }, { "extension", ExtensionRole, kli18nc("@label", "File Extension"), kli18nc("@label", "Other"), KLazyLocalizedString(), false, false }, { "deletiontime", DeletionTimeRole, kli18nc("@label", "Deletion Time"), kli18nc("@label", "Other"), KLazyLocalizedString(), false, false }, diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index 10be27128..29d6876a3 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -348,6 +348,10 @@ private: OriginUrlRole, AspectRatioRole, FrameRateRole, + AudioCodecRole, + VideoCodecRole, + PixelFormatRole, + ColorSpaceRole, // Non-visible roles: IsDirRole, IsLinkRole, diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp index d0632e2c5..836eb95a4 100644 --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -10,6 +10,7 @@ #include <Baloo/File> #include <KFileMetaData/PropertyInfo> #include <KFileMetaData/UserMetaData> +#include <kfilemetadata_version.h> #include <QCollator> #include <QSize> @@ -34,28 +35,34 @@ QString tagsFromValues(const QStringList &values) using Property = KFileMetaData::Property::Property; // Mapping from the KFM::Property to the KFileItemModel roles. const QHash<Property, QByteArray> propertyRoleMap() { - static const auto map = QHash<Property, QByteArray> { - { Property::Rating, QByteArrayLiteral("rating") }, - { 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") }, - { Property::Height, QByteArrayLiteral("height") }, - { Property::ImageDateTime, QByteArrayLiteral("imageDateTime") }, - { Property::ImageOrientation, QByteArrayLiteral("orientation") }, - { Property::Artist, QByteArrayLiteral("artist") }, - { Property::Genre, QByteArrayLiteral("genre") }, - { Property::Album, QByteArrayLiteral("album") }, - { Property::Duration, QByteArrayLiteral("duration") }, - { Property::BitRate, QByteArrayLiteral("bitrate") }, - { Property::AspectRatio, QByteArrayLiteral("aspectRatio") }, - { Property::FrameRate, QByteArrayLiteral("frameRate") }, - { Property::ReleaseYear, QByteArrayLiteral("releaseYear") }, - { Property::TrackNumber, QByteArrayLiteral("track") } + static const auto map = QHash<Property, QByteArray>{ + {Property::Rating, QByteArrayLiteral("rating")}, + {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")}, + {Property::Height, QByteArrayLiteral("height")}, + {Property::ImageDateTime, QByteArrayLiteral("imageDateTime")}, + {Property::ImageOrientation, QByteArrayLiteral("orientation")}, + {Property::Artist, QByteArrayLiteral("artist")}, + {Property::Genre, QByteArrayLiteral("genre")}, + {Property::Album, QByteArrayLiteral("album")}, + {Property::Duration, QByteArrayLiteral("duration")}, + {Property::BitRate, QByteArrayLiteral("bitrate")}, + {Property::AspectRatio, QByteArrayLiteral("aspectRatio")}, + {Property::FrameRate, QByteArrayLiteral("frameRate")}, + {Property::ReleaseYear, QByteArrayLiteral("releaseYear")}, + {Property::TrackNumber, QByteArrayLiteral("track")}, +#if KFILEMETADATA_VERSION >= QT_VERSION_CHECK(6, 13, 0) + {Property::AudioCodec, QByteArrayLiteral("audioCodec")}, + {Property::VideoCodec, QByteArrayLiteral("videoCodec")}, + {Property::PixelFormat, QByteArrayLiteral("pixelFormat")}, + {Property::ColorSpace, QByteArrayLiteral("colorSpace")}, +#endif }; return map; } |
