diff --git a/src/extractionresult.h b/src/extractionresult.h --- a/src/extractionresult.h +++ b/src/extractionresult.h @@ -46,11 +46,20 @@ class KFILEMETADATA_EXPORT ExtractionResult { public: + /** + * Flags which determine which properties shall be extracted. + * @todo KF6 cleanup flag naming + */ enum Flag { ExtractNothing = 0, ExtractMetaData = 1, ExtractPlainText = 2, - ExtractEverything = (ExtractMetaData | ExtractPlainText) + ExtractEverything = (ExtractMetaData | ExtractPlainText), + /** + * @since 5.65 + */ + ExtractBinaryData = 4, + ExtractEverythingIncludingBinary = (ExtractEverything | ExtractBinaryData), }; Q_DECLARE_FLAGS(Flags, Flag) diff --git a/src/properties.h b/src/properties.h --- a/src/properties.h +++ b/src/properties.h @@ -387,6 +387,14 @@ */ Description, + /** + * Contains the front cover image of e.g. an album as binary + * data. The ExtractionsResult::ExtractBinaryData flag must + * be set to extract this property. + * @since 5.65 + */ + FrontCover, + PropertyCount, LastProperty = PropertyCount-1, diff --git a/src/propertyinfo.cpp b/src/propertyinfo.cpp --- a/src/propertyinfo.cpp +++ b/src/propertyinfo.cpp @@ -578,9 +578,16 @@ d->shouldBeIndexed = false; break; - case Property::PropertyCount: // To silence the compiler. + case Property::FrontCover: + d->name = QStringLiteral("frontCover"); + d->displayName = i18nc("@label", "Front Cover Image"); + d->valueType = QVariant::ByteArray; + d->shouldBeIndexed = false; break; + case Property::PropertyCount: // To silence the compiler. + break; + // NOTE: new properties must also be added to ::fromName() } @@ -736,7 +743,8 @@ { QStringLiteral("originurl"), Property::OriginUrl }, { QStringLiteral("originemailsubject"), Property::OriginEmailSubject }, { QStringLiteral("originemailsender"), Property::OriginEmailSender }, - { QStringLiteral("originemailmessageid"), Property::OriginEmailMessageId } + { QStringLiteral("originemailmessageid"), Property::OriginEmailMessageId }, + { QStringLiteral("frontcover"), Property::FrontCover } }; return PropertyInfo(propertyHash.value(name.toLower()));