diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -31,14 +31,14 @@ if(KF5Archive_FOUND) ecm_add_test(odfextractortest.cpp ../src/extractors/odfextractor.cpp TEST_NAME "odfextractortest" - LINK_LIBRARIES Qt5::Test Qt5::Xml KF5::FileMetaData KF5::Archive + LINK_LIBRARIES Qt5::Test Qt5::Xml KF5::FileMetaData KF5::Archive KF5::I18n ) endif() if(KF5Archive_FOUND) ecm_add_test(office2007extractortest.cpp ../src/extractors/office2007extractor.cpp TEST_NAME "officeextractortest" - LINK_LIBRARIES Qt5::Test Qt5::Xml KF5::FileMetaData KF5::Archive + LINK_LIBRARIES Qt5::Test Qt5::Xml KF5::FileMetaData KF5::Archive KF5::I18n ) endif() @@ -60,7 +60,7 @@ ecm_add_test(epubextractortest.cpp ../src/extractors/epubextractor.cpp TEST_NAME "epubextractortest" - LINK_LIBRARIES Qt5::Test KF5::FileMetaData ${EPUB_LIBRARIES} + LINK_LIBRARIES Qt5::Test KF5::FileMetaData KF5::I18n ${EPUB_LIBRARIES} ) endif() diff --git a/autotests/epubextractortest.h b/autotests/epubextractortest.h --- a/autotests/epubextractortest.h +++ b/autotests/epubextractortest.h @@ -32,6 +32,9 @@ private Q_SLOTS: void test(); void testMetaDataOnly(); + + void testMetadata(); + void testMetadata_data(); }; #endif // EPUBEXTRACTORTEST_H diff --git a/autotests/epubextractortest.cpp b/autotests/epubextractortest.cpp --- a/autotests/epubextractortest.cpp +++ b/autotests/epubextractortest.cpp @@ -22,18 +22,96 @@ #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/epubextractor.h" +#include "propertyinfo.h" + +#include #include #include #include using namespace KFileMetaData; +Q_DECLARE_METATYPE(QVariant::Type) +Q_DECLARE_METATYPE(Property::Property) QString EPubExtractorTest::testFilePath(const QString& fileName) const { return QLatin1String(INDEXER_TESTS_SAMPLE_FILES_PATH) + QDir::separator() + fileName; } +void EPubExtractorTest::testMetadata_data() +{ + QTest::addColumn("property"); + QTest::addColumn("expectedValue"); + QTest::addColumn("expectedType"); + QTest::addColumn("expectedLabel"); + + QTest::addRow("Author") + << Property::Author + << QVariant(QStringLiteral("Happy Man")) + << QVariant::StringList + << i18nc("@label", "Author") + ; + QTest::addRow("Publisher") + << Property::Publisher + << QVariant(QStringLiteral("Happy Publisher")) + << QVariant::String + << i18nc("@label", "Publisher") + ; + QTest::addRow("Title") + << Property::Title + << QVariant(QStringLiteral("The Big Brown Bear")) + << QVariant::String + << i18nc("@label", "Title") + ; + QTest::addRow("Subject") + << Property::Subject + << QVariant(QStringLiteral("Baloo KFileMetaData")) + << QVariant::String + << i18nc("@label", "Subject") + ; + QTest::addRow("Description") + << Property::Description + << QVariant(QStringLiteral("This describes Baloo KFileMetaData")) + << QVariant::String + << i18nc("@label", "Description") + ; + QTest::addRow("Comment") + << Property::Comment + << QVariant(QVariant::Invalid) + << QVariant::String + << i18nc("@label", "Comment") + ; +} +// TODO: change properties of sample file +// to match properties of office files +// change tests accordingly +void EPubExtractorTest::testMetadata() +{ + QFETCH(Property::Property, property); + QFETCH(QVariant, expectedValue); + QFETCH(QVariant::Type, expectedType); + QFETCH(QString, expectedLabel); + + + SimpleExtractionResult result(QFINDTESTDATA("samplefiles/test.epub"), "application/epub+zip"); + QScopedPointer plugin(new EPubExtractor(this)); + plugin->extract(&result); + const auto properties = result.properties(); + const auto propertyInfo = PropertyInfo(property); + + // qDebug() << "result: " << propertyInfo.valueType() << propertyInfo.displayName() << "=" << properties.value(property); + // qDebug() << "expected:" << expectedType << expectedLabel << "=" << expectedValue; + QCOMPARE(propertyInfo.valueType(), expectedType); + QCOMPARE(propertyInfo.displayName(), expectedLabel); + QCOMPARE(PropertyInfo::fromName(expectedLabel), property); + if (propertyInfo.valueType() == QVariant::StringList) { + QCOMPARE(properties.value(property), expectedValue); + } else { + QCOMPARE(properties.value(property), expectedValue); + } +} + void EPubExtractorTest::test() { QScopedPointer plugin(new EPubExtractor(this)); @@ -56,7 +134,7 @@ dt.setTimeSpec(Qt::UTC); QCOMPARE(result.properties().value(Property::CreationDate), QVariant(dt)); - QCOMPARE(result.properties().size(), 5); + QCOMPARE(result.properties().size(), 6); } void EPubExtractorTest::testMetaDataOnly() diff --git a/autotests/odfextractortest.h b/autotests/odfextractortest.h --- a/autotests/odfextractortest.h +++ b/autotests/odfextractortest.h @@ -38,6 +38,10 @@ void testTextMissingMetaNoCrash(); void testTextMissingContentNoCrash(); + + void testMetadata(); + void testMetadata_data(); + }; #endif // ODFEXTRACTORTEST_H diff --git a/autotests/odfextractortest.cpp b/autotests/odfextractortest.cpp --- a/autotests/odfextractortest.cpp +++ b/autotests/odfextractortest.cpp @@ -25,11 +25,17 @@ #include #include +#include + #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/odfextractor.h" +#include "propertyinfo.h" + using namespace KFileMetaData; +Q_DECLARE_METATYPE(QVariant::Type) +Q_DECLARE_METATYPE(Property::Property) QString OdfExtractorTest::testFilePath(const QString& fileName) const { @@ -49,6 +55,7 @@ QCOMPARE(result.properties().value(Property::Title), QVariant(QStringLiteral("KFileMetaData Title"))); QCOMPARE(result.properties().value(Property::Subject), QVariant(QStringLiteral("KFileMetaData Subject"))); QCOMPARE(result.properties().value(Property::Keywords), QVariant(QStringLiteral("KFileMetaData keyword"))); + QEXPECT_FAIL("", "'Comment' is no longer provided, use 'Description' instead", Continue); QCOMPARE(result.properties().value(Property::Comment), QVariant(QStringLiteral("KFileMetaData comment"))); QVERIFY(result.properties().value(Property::Generator).toString().contains(QStringLiteral("LibreOffice"))); @@ -107,4 +114,91 @@ plugin->extract(&result); } +void OdfExtractorTest::testMetadata_data() +{ + QTest::addColumn("sampleFile"); + QTest::addColumn("mimeType"); + QTest::addColumn("property"); + QTest::addColumn("expectedValue"); + QTest::addColumn("expectedType"); + QTest::addColumn("expectedLabel"); + + const QVector> sampleFiles = { + {QStringLiteral("test.odt"), QStringLiteral("application/vnd.oasis.opendocument.text")}, + {QStringLiteral("test_missing_content.odt"), QStringLiteral("application/vnd.oasis.opendocument.text")} + }; + for (const auto& sample : sampleFiles) { + QTest::newRow(qPrintable(QStringLiteral("%1:Author").arg(sample.first))) + << QFINDTESTDATA(QStringLiteral("samplefiles/%1").arg(sample.first)) + << sample.second + << Property::Author + << QVariant() + << QVariant::StringList + << i18nc("@label", "Author") + ; + QTest::newRow(qPrintable(QStringLiteral("%1:Title").arg(sample.first))) + << QFINDTESTDATA(QStringLiteral("samplefiles/%1").arg(sample.first)) + << sample.second + << Property::Title + << QVariant(QStringLiteral("KFileMetaData Title")) + << QVariant::String + << i18nc("@label", "Title") + ; + QTest::newRow(qPrintable(QStringLiteral("%1:Subject").arg(sample.first))) + << QFINDTESTDATA(QStringLiteral("samplefiles/%1").arg(sample.first)) + << sample.second + << Property::Subject + << QVariant(QStringLiteral("KFileMetaData Subject")) + << QVariant::String + << i18nc("@label", "Subject") + ; + QTest::newRow(qPrintable(QStringLiteral("%1:Description").arg(sample.first))) + << QFINDTESTDATA(QStringLiteral("samplefiles/%1").arg(sample.first)) + << sample.second + << Property::Description + << QVariant(QStringLiteral("KFileMetaData comment")) + << QVariant::String + << i18nc("@label", "Description") + ; + QTest::newRow(qPrintable(QStringLiteral("%1:Comment").arg(sample.first))) + << QFINDTESTDATA(QStringLiteral("samplefiles/%1").arg(sample.first)) + << sample.second + << Property::Comment + << QVariant(QVariant::Invalid) + << QVariant::String + << i18nc("@label", "Comment") + ; + } +} + +void OdfExtractorTest::testMetadata() +{ + QFETCH(QString, sampleFile); + QFETCH(QString, mimeType); + QFETCH(Property::Property, property); + QFETCH(QVariant, expectedValue); + QFETCH(QVariant::Type, expectedType); + QFETCH(QString, expectedLabel); + + + SimpleExtractionResult result(sampleFile, mimeType); + QScopedPointer plugin(new OdfExtractor(this)); + plugin->extract(&result); + const auto properties = result.properties(); + const auto propertyInfo = PropertyInfo(property); + + // qDebug() << "result: " << propertyInfo.valueType() << propertyInfo.displayName() << "=" << properties.value(property); + // qDebug() << "expected:" << expectedType << expectedLabel << "=" << expectedValue; + QCOMPARE(propertyInfo.valueType(), expectedType); + QCOMPARE(propertyInfo.displayName(), expectedLabel); + QCOMPARE(PropertyInfo::fromName(expectedLabel), property); + if (propertyInfo.valueType() == QVariant::StringList) { + QCOMPARE(properties.value(property), expectedValue); + } else { + QCOMPARE(properties.value(property), expectedValue); + } +} + + + QTEST_GUILESS_MAIN(OdfExtractorTest) diff --git a/autotests/office2007extractortest.h b/autotests/office2007extractortest.h --- a/autotests/office2007extractortest.h +++ b/autotests/office2007extractortest.h @@ -32,6 +32,10 @@ private Q_SLOTS: void test(); void testMetaDataOnly(); + + void testMetadata(); + void testMetadata_data(); + }; #endif // OFFICE2007EXTRACTORTEST_H diff --git a/autotests/office2007extractortest.cpp b/autotests/office2007extractortest.cpp --- a/autotests/office2007extractortest.cpp +++ b/autotests/office2007extractortest.cpp @@ -22,12 +22,17 @@ #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/office2007extractor.h" +#include "propertyinfo.h" + +#include #include #include #include using namespace KFileMetaData; +Q_DECLARE_METATYPE(QVariant::Type) +Q_DECLARE_METATYPE(Property::Property) QString Office2007ExtractorTest::testFilePath(const QString& fileName) const { @@ -47,6 +52,7 @@ QCOMPARE(result.properties().value(Property::Title), QVariant(QStringLiteral("KFileMetaData Title"))); QCOMPARE(result.properties().value(Property::Subject), QVariant(QStringLiteral("KFileMetaData Subject"))); QCOMPARE(result.properties().value(Property::Keywords), QVariant(QStringLiteral("KFileMetaData keyword"))); + QEXPECT_FAIL("", "'Comment' is no longer provided, use 'Description' instead", Continue); QCOMPARE(result.properties().value(Property::Comment), QVariant(QStringLiteral("KFileMetaData comment"))); QCOMPARE(result.properties().value(Property::Langauge), QVariant(QStringLiteral("en-US"))); QVERIFY(result.properties().value(Property::Generator).toString().contains(QStringLiteral("LibreOffice"))); @@ -73,5 +79,75 @@ QVERIFY(!result.properties().isEmpty()); QVERIFY(result.text().isEmpty()); } +void Office2007ExtractorTest::testMetadata_data() +{ + QTest::addColumn("property"); + QTest::addColumn("expectedValue"); + QTest::addColumn("expectedType"); + QTest::addColumn("expectedLabel"); + + QTest::addRow("Author") + << Property::Author + << QVariant() + << QVariant::StringList + << i18nc("@label", "Author") + ; + QTest::addRow("Publisher") + << Property::Publisher + << QVariant(QVariant::Invalid) + << QVariant::String + << i18nc("@label", "Publisher") + ; + QTest::addRow("Title") + << Property::Title + << QVariant(QStringLiteral("KFileMetaData Title")) + << QVariant::String + << i18nc("@label", "Title") + ; + QTest::addRow("Subject") + << Property::Subject + << QVariant(QStringLiteral("KFileMetaData Subject")) + << QVariant::String + << i18nc("@label", "Subject") + ; + QTest::addRow("Description") + << Property::Description + << QVariant(QStringLiteral("KFileMetaData comment")) + << QVariant::String + << i18nc("@label", "Description") + ; + QTest::addRow("Comment") + << Property::Comment + << QVariant(QVariant::Invalid) + << QVariant::String + << i18nc("@label", "Comment") + ; +} + +void Office2007ExtractorTest::testMetadata() +{ + QFETCH(Property::Property, property); + QFETCH(QVariant, expectedValue); + QFETCH(QVariant::Type, expectedType); + QFETCH(QString, expectedLabel); + + SimpleExtractionResult result(QFINDTESTDATA("samplefiles/test_libreoffice.docx"), + QStringLiteral("application/vnd.openxmlformats-officedocument.wordprocessingml.document")); + QScopedPointer plugin(new Office2007Extractor(this)); + plugin->extract(&result); + const auto properties = result.properties(); + const auto propertyInfo = PropertyInfo(property); + + // qDebug() << "result: " << propertyInfo.valueType() << propertyInfo.displayName() << "=" << properties.value(property); + // qDebug() << "expected:" << expectedType << expectedLabel << "=" << expectedValue; + QCOMPARE(propertyInfo.valueType(), expectedType); + QCOMPARE(propertyInfo.displayName(), expectedLabel); + QCOMPARE(PropertyInfo::fromName(expectedLabel), property); + if (propertyInfo.valueType() == QVariant::StringList) { + QCOMPARE(properties.value(property), expectedValue); + } else { + QCOMPARE(properties.value(property), expectedValue); + } +} QTEST_GUILESS_MAIN(Office2007ExtractorTest) diff --git a/autotests/samplefiles/test.epub b/autotests/samplefiles/test.epub index cc7cfad9384c0d4a47dcf5f68cade7e409699e06..8a2f994c58a3af092455a6a2b369acf400832f1e GIT binary patch literal 5129 zc$|e;cT`i~vZhM!O^OgolqM)0M0!VhM~Xl~5-Fhs=~bx;NGQ@orJK;30s?|`kRlxf z1wxT3z2l4Tci%#}_pZ0knm=Z*^Uc}&%%1sXkG?iO0X@#|K?#~uf!m=4e`~*m7%MI? z7cj!t4Q%J;<_vSNL%`s!!eBQqdjUU~oBqF$#5m&*=2V_-4GH<<;^5Tc;ouNqXAy7* zAy)^VSmd;8&MoTj%^ms_c!j@RuPs33xz-Pt`ungGyvKKOdCC$*#SpI=pFeS}n$+@# z^am^*_I4h98n0fXn0{NHZ%&leH=H zVsUrF!mR6?L5&V*`Gi&a4KmnryY@Ps9NPQly%IK^wgZ9oZ5GA;$RFdJxJIMYEa_47 z_ECwk#AoA7?(}N*tWN;cG_)p;9S&u)y$X?pW5yd1YMw`W1wYw`#*NMh3tzivMXufd z-qyGj+%#qa9l*6X2p?^V?4qp_)}PI}Mt&Bb{n&jmnA|%0-3^c0wd-T14HCn1pCjFJ z&zxe{28`FfuT7NUhxIJvxhKpBc;LhP2fnoqEwo8QnCFnm5oogI1NlQUa%kP3=i9S_ z)1nxzhw3H@4$(jY$u{L*s+s)^u?;NI)zi1Hr%wSj5wo30H~9(ka?i$T^4 z2z?xMtWRoh*XB0pR+A(9Ih>o0asKuXAXW$9jrC6p)<2}!S(qyb>>~t4xH!imZ^Ngs zF7o~rgU>`2u7Yx%G*4#xND+po8bUrpW+|iT3_}9@6V5iZE%{!HvE#W(J^$vf-ss@v zEd%vY<46+UtLSW_9T2NA$uE7OzEUx@FzskSL0=w~u3s72nVcCvpBj(;dYr|yx|jZn z_LD+SAxN-!LA${M#~8m`f}xy8l|`~1*ADGB?stb}JbRbnmG1SG5T52v{Lv!y$2Q14 zauz3Iijm&xYZE=yDvigzhxe0Zzx>qNwwCdZP=}Qa7V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1?9Lmg{TsF_~NFOqisU?z-*rIygA!L6ia$GA!^MR#z(<^6{yXBAQ(9ks35Y zwMZ?^RSkSIF-ra#=+Z2WHQ9YXY|8o~F1z0g(cJ!bx|ugQn9vMlI{ZQ!CDPR7b)~tK z)fKq^%_uuJ>F4EnDxO!;BTjAeba}ZnIMcjA&_zo|N{_nbLtJ^?|LcDRBf? zM+VJ#@VJ6CA^5iU-;_klaz!p;F{+9WxeH;WJ^aUREFBmyOE-IWAk+)` zFJXz*0CKUbjBrG9Baii1jlr?8Q8muN=~AuonyN2+p%a%1m#k6_cHqw#$nzWpl^pHA z4`KfA0}BHDZ6tF`{pSJ9EhTn4j=2lnoeJDS^C*9x5!~hOwyU?CH`?Eu*Sp+ZQNHDd zaPLa=UG}bi-m)fm|E8vQ;kzn%3)kWOn`ZtU{!gd;EzCpkk2C-7UGL_>EvQKR-?HNG iKK|3&ck6?Kadd(Property::Comment, value); + result->add(Property::Description, value); } value = fetchMetadata(ePubDoc, EPUB_DATE); diff --git a/src/extractors/odfextractor.cpp b/src/extractors/odfextractor.cpp --- a/src/extractors/odfextractor.cpp +++ b/src/extractors/odfextractor.cpp @@ -80,7 +80,7 @@ // Dublin Core if (tagName == QLatin1String("dc:description")) { - result->add(Property::Comment, e.text()); + result->add(Property::Description, e.text()); } else if (tagName == QLatin1String("dc:subject")) { result->add(Property::Subject, e.text()); } else if (tagName == QLatin1String("dc:title")) { diff --git a/src/extractors/office2007extractor.cpp b/src/extractors/office2007extractor.cpp --- a/src/extractors/office2007extractor.cpp +++ b/src/extractors/office2007extractor.cpp @@ -85,7 +85,7 @@ if (!elem.isNull()) { QString str = elem.text(); if (!str.isEmpty()) { - result->add(Property::Comment, str); + result->add(Property::Description, str); } } diff --git a/src/properties.h b/src/properties.h --- a/src/properties.h +++ b/src/properties.h @@ -269,6 +269,7 @@ * Represents the disc number in a multi-disc set. Typically maps to the "TPOS" tag for mp3 */ DiscNumber, + Description, PropertyCount, LastProperty = PropertyCount-1, diff --git a/src/propertyinfo.cpp b/src/propertyinfo.cpp --- a/src/propertyinfo.cpp +++ b/src/propertyinfo.cpp @@ -92,6 +92,12 @@ d->shouldBeIndexed = false; break; + case Property::Description: + d->name = QStringLiteral("description"); + d->displayName = i18nc("@label", "Description"); + d->valueType = QVariant::String; + break; + case Property::Composer: d->name = QStringLiteral("composer"); d->displayName = i18nc("@label", "Composer"); @@ -515,6 +521,7 @@ { QStringLiteral("discnumber"), Property::DiscNumber }, { QStringLiteral("releaseyear"), Property::ReleaseYear }, { QStringLiteral("comment"), Property::Comment }, + { QStringLiteral("description"), Property::Description }, { QStringLiteral("artist"), Property::Artist }, { QStringLiteral("album"), Property::Album }, { QStringLiteral("albumartist"), Property::AlbumArtist },