Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: kfilemetadata-kf5

kfilemetadata-kf5 (5.61.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.61.0) -- José Manuel Santamaría Lema <panfaust@gmail.com> Mon, 12 Aug 2019 10:42:04 +0100 kfilemetadata-kf5 (5.60.0-0ubuntu1) eoan; urgency=medium * Move qdebug categories file to new location. * New upstream release (5.60.0) * Update symbols from build logs. -- Rik Mills <rikmills@kubuntu.org> Sat, 20 Jul 2019 08:15:47 +0100 kfilemetadata-kf5 (5.59.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.59.0) * Update patches. -- Rik Mills <rikmills@kubuntu.org> Wed, 12 Jun 2019 11:18:57 +0100 kfilemetadata-kf5 (5.58.0-0ubuntu2) eoan; urgency=medium * Add debian/patches/fix-propertyinfotest.patch -- Rik Mills <rikmills@kubuntu.org> Tue, 14 May 2019 10:27:06 +0100 kfilemetadata-kf5 (5.58.0-0ubuntu1) eoan; urgency=medium * Drop upstream_propertyinfotest-force-en-locale.patch included in 5.58 * New upstream release (5.58.0) -- Rik Mills <rikmills@kubuntu.org> Mon, 13 May 2019 15:39:51 +0100 kfilemetadata-kf5 (5.57.0-0ubuntu2) eoan; urgency=medium * Add upstream_propertyinfotest-force-en-locale.patch to fix autopkgtests for 5.57.0 -- Rik Mills <rikmills@kubuntu.org> Tue, 23 Apr 2019 06:54:10 +0100 kfilemetadata-kf5 (5.57.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.57.0) * Update symbols from build logs. -- Rik Mills <rikmills@kubuntu.org> Mon, 22 Apr 2019 08:37:32 +0100 kfilemetadata-kf5 (5.56.0-0ubuntu1) disco; urgency=medium [ Rik Mills ] * New build dep on libkf5coreaddons-dev. * Update symbols from build logs. * lintian override for file not used or installed. [ José Manuel Santamaría Lema ] * New upstream release (5.56.0) -- José Manuel Santamaría Lema <panfaust@gmail.com> Sat, 09 Mar 2019 16:35:38 +0000 kfilemetadata-kf5 (5.55.0-0ubuntu1) disco; urgency=medium * New upstream release (5.55.0) -- Rik Mills <rikmills@kubuntu.org> Wed, 13 Feb 2019 08:30:50 +0000 kfilemetadata-kf5 (5.54.0-0ubuntu1) disco; urgency=medium * Add qttools5-dev for Qt5Help. * New upstream release (5.54.0) -- Rik Mills <rikmills@kubuntu.org> Sun, 13 Jan 2019 12:34:40 +0000 kfilemetadata-kf5 (5.53.0-0ubuntu1) disco; urgency=medium * New upstream release (5.53.0) -- José Manuel Santamaría Lema <panfaust@gmail.com> Sun, 09 Dec 2018 20:48:25 +0000 kfilemetadata-kf5 (5.52.0-0ubuntu1) disco; urgency=medium [ Rik Mills ] * New upstream release (5.51.0) [ José Manuel Santamaría Lema ] * New upstream release (5.52.0) * Update symbols files * Add libkf5coreaddons-data to testsuite Depends, see https://phabricator.kde.org/D16593 for more information -- José Manuel Santamaría Lema <panfaust@gmail.com> Thu, 22 Nov 2018 14:41:56 +0000 kfilemetadata-kf5 (5.50.0-0ubuntu1) cosmic; urgency=medium * New upstream release (5.50.0) -- Rik Mills <rikmills@kubuntu.org> Mon, 10 Sep 2018 22:13:01 +0100 kfilemetadata-kf5 (5.49.0-0ubuntu1) cosmic; urgency=medium [ Rik Mills ] * New upstream release (5.48.0) * Update symbols from build logs * New upstream release (5.49.0) [ José Manuel Santamaría Lema ] * Move away from dhmk and set compat level to 11 in order to reduce delta with Debian -- Rik Mills <rikmills@kubuntu.org> Tue, 21 Aug 2018 20:29:56 +0100 kfilemetadata-kf5 (5.47.0-0ubuntu1) cosmic; urgency=medium * New upstream release (5.47.0) [ José Manuel Santamaría Lema ] * Merge with debian, notes: - keep using dhmk and debhelper compat level = 9, see: https://phabricator.kde.org/w/kubuntu/black-operations/pyramid/ -- Rik Mills <rikmills@kubuntu.org> Thu, 14 Jun 2018 15:48:50 +0100

Modifications :
  1. Download patch autotests/ffmpegextractortest.cpp

    --- 5.54.0-1/autotests/ffmpegextractortest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/ffmpegextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2019 Alexander Stippich <a.stippich@gmx.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "ffmpegextractortest.h" +#include "simpleextractionresult.h" +#include "indexerextractortestsconfig.h" +#include "extractors/ffmpegextractor.h" +#include "mimeutils.h" + +#include <QTest> + +using namespace KFileMetaData; + +namespace { + +QString testFilePath(const QString& baseName, const QString& extension) +{ + return QLatin1String(INDEXER_TESTS_SAMPLE_FILES_PATH) + + QLatin1Char('/') + baseName + QLatin1Char('.') + extension; +} + +} // namespace + +void ffmpegExtractorTest::testVideoProperties_data() +{ + QTest::addColumn<QString>("fileType"); + + QTest::addRow("WebM") + << QStringLiteral("webm"); + + QTest::addRow("Matroska Video") + << QStringLiteral("mkv"); + + QTest::addRow("Vorbis Video") + << QStringLiteral("ogv"); + + QTest::addRow("MPEG Transport") + << QStringLiteral("ts"); +} + +// only for testing of intrinsic video properties +void ffmpegExtractorTest::testVideoProperties() +{ + QFETCH(QString, fileType); + + QString fileName = testFilePath(QStringLiteral("test"), fileType); + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + + FFmpegExtractor plugin{this}; + + QVERIFY(plugin.mimetypes().contains(plugin.getSupportedMimeType(mimeType))); + + SimpleExtractionResult result(fileName, mimeType); + plugin.extract(&result); + + QCOMPARE(result.types().size(), 1); + QCOMPARE(result.types().constFirst(), Type::Video); + + QCOMPARE(result.properties().value(Property::Width).toInt(), 1280); + QCOMPARE(result.properties().value(Property::Height).toInt(), 720); + QCOMPARE(result.properties().value(Property::FrameRate).toDouble(), 24.0/1.001); + QCOMPARE(result.properties().value(Property::AspectRatio).toDouble(), 16.0/9); +} + +void ffmpegExtractorTest::testMetaData_data() +{ + QTest::addColumn<QString>("fileType"); + + QTest::addRow("WebM") + << QStringLiteral("webm"); + + QTest::addRow("Matroska Video") + << QStringLiteral("mkv"); + + QTest::addRow("Vorbis Video") + << QStringLiteral("ogv"); +} + +void ffmpegExtractorTest::testMetaData() +{ + QFETCH(QString, fileType); + + QString fileName = testFilePath(QStringLiteral("test"), fileType); + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + + FFmpegExtractor plugin{this}; + + SimpleExtractionResult result(fileName, mimeType); + plugin.extract(&result); + + QEXPECT_FAIL("Vorbis Video", "Not yet supported", Abort); + QCOMPARE(result.properties().value(Property::Title).toString(), QStringLiteral("Title")); + QCOMPARE(result.properties().value(Property::Copyright).toString(), QStringLiteral("Copyright")); + QCOMPARE(result.properties().value(Property::Author).toString(), QStringLiteral("Author")); + QCOMPARE(result.properties().value(Property::ReleaseYear).toInt(), 2019); +} +QTEST_GUILESS_MAIN(ffmpegExtractorTest)
  2. Download patch src/extractionresult.h

    --- 5.54.0-1/src/extractionresult.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/src/extractionresult.h 2019-08-03 19:54:00.000000000 +0000 @@ -72,7 +72,10 @@ public: /** * The input mimetype. This mimetype should correspond with the * mimetypes supported with the relevant plugin when it is being - * passed to the Extractor + * passed to the Extractor, or be a subtype thereof. + * + * \sa ExtractorCollection::fetchExtractors + * \sa ExtractorPlugin::supportedMimeType */ QString inputMimetype() const; @@ -105,7 +108,7 @@ public: * This function is called by the plugins. * A type is a higher level classification of the file. A file can * have multiple types, but mostly when it does, those types are related. - * Eg - Document and Presenentation. + * Eg - Document and Presentation. * * Please choose one type from the list of available types */
  3. Download patch po/sr@latin/kfilemetadata5.po
  4. Download patch po/zh_TW/kfilemetadata5.po
  5. Download patch debian/libkf5filemetadata3.symbols

    --- 5.54.0-1/debian/libkf5filemetadata3.symbols 2019-01-17 22:26:48.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/libkf5filemetadata3.symbols 2019-08-12 09:42:04.000000000 +0000 @@ -1,10 +1,12 @@ -# SymbolsHelper-Confirmed: 5.52.0 amd64 +# SymbolsHelper-Confirmed: 5.60.0 amd64 arm64 armhf i386 ppc64el s390x libKF5FileMetaData.so.3 libkf5filemetadata3 #MINVER# _ZN13KFileMetaData12PropertyInfo8fromNameERK7QString@Base 5.0.0 _ZN13KFileMetaData12PropertyInfoC1ENS_8Property8PropertyE@Base 5.0.0 _ZN13KFileMetaData12PropertyInfoC1ERKS0_@Base 5.0.0 + _ZN13KFileMetaData12PropertyInfoC1Ev@Base 5.57.0 _ZN13KFileMetaData12PropertyInfoC2ENS_8Property8PropertyE@Base 5.0.0 _ZN13KFileMetaData12PropertyInfoC2ERKS0_@Base 5.0.0 + _ZN13KFileMetaData12PropertyInfoC2Ev@Base 5.57.0 _ZN13KFileMetaData12PropertyInfoD1Ev@Base 5.0.0 _ZN13KFileMetaData12PropertyInfoD2Ev@Base 5.0.0 _ZN13KFileMetaData12PropertyInfoaSERKS0_@Base 5.0.2+git20140925 @@ -56,11 +58,12 @@ libKF5FileMetaData.so.3 libkf5filemetada _ZN13KFileMetaData16WriterCollectionD0Ev@Base 5.22.0 _ZN13KFileMetaData16WriterCollectionD1Ev@Base 5.22.0 _ZN13KFileMetaData16WriterCollectionD2Ev@Base 5.22.0 - _ZN13KFileMetaData17EmbeddedImageDataC1Ev@Base 5.49.0 - _ZN13KFileMetaData17EmbeddedImageDataC2Ev@Base 5.49.0 - _ZN13KFileMetaData17EmbeddedImageDataD0Ev@Base 5.49.0 - _ZN13KFileMetaData17EmbeddedImageDataD1Ev@Base 5.49.0 - _ZN13KFileMetaData17EmbeddedImageDataD2Ev@Base 5.49.0 + _ZN13KFileMetaData17EmbeddedImageDataC1Ev@Base 5.48.0 + _ZN13KFileMetaData17EmbeddedImageDataC2Ev@Base 5.48.0 + _ZN13KFileMetaData17EmbeddedImageDataD0Ev@Base 5.48.0 + _ZN13KFileMetaData17EmbeddedImageDataD1Ev@Base 5.48.0 + _ZN13KFileMetaData17EmbeddedImageDataD2Ev@Base 5.48.0 + _ZN13KFileMetaData19ExtractorCollection13allExtractorsEv@Base 5.57.0 _ZN13KFileMetaData19ExtractorCollectionC1Ev@Base 5.0.2+git20140925 _ZN13KFileMetaData19ExtractorCollectionC2Ev@Base 5.0.2+git20140925 _ZN13KFileMetaData19ExtractorCollectionD0Ev@Base 5.0.2+git20140925 @@ -92,14 +95,19 @@ libKF5FileMetaData.so.3 libkf5filemetada _ZN13KFileMetaData8TypeInfoD2Ev@Base 5.0.0 _ZN13KFileMetaData8TypeInfoaSERKS0_@Base 5.0.2+git20140925 _ZN13KFileMetaData8TypeInfoeqERKS0_@Base 5.0.2+git20140925 - _ZN13KFileMetaData9Extractor18setExtractorPluginEPNS_15ExtractorPluginE@Base 5.41.0 - _ZN13KFileMetaData9Extractor19setAutoDeletePluginENS0_24ExtractorPluginOwnershipE@Base 5.41.0 + _ZN13KFileMetaData9Extractor11setMetaDataERK4QMapI7QString8QVariantE@Base 5.56.0 + _ZN13KFileMetaData9Extractor16ExtractorPrivate10initPluginEv@Base 5.57.0 + _ZN13KFileMetaData9Extractor18setExtractorPluginEPNS_15ExtractorPluginE@Base 5.39.0 + _ZN13KFileMetaData9Extractor19setAutoDeletePluginENS0_24ExtractorPluginOwnershipE@Base 5.39.0 _ZN13KFileMetaData9Extractor7extractEPNS_16ExtractionResultE@Base 5.0.2+git20140925 + _ZN13KFileMetaData9ExtractorC1EOS0_@Base 5.57.0 _ZN13KFileMetaData9ExtractorC1Ev@Base 5.0.2+git20140925 + _ZN13KFileMetaData9ExtractorC2EOS0_@Base 5.57.0 _ZN13KFileMetaData9ExtractorC2Ev@Base 5.0.2+git20140925 _ZN13KFileMetaData9ExtractorD0Ev@Base 5.0.2+git20140925 _ZN13KFileMetaData9ExtractorD1Ev@Base 5.0.2+git20140925 _ZN13KFileMetaData9ExtractorD2Ev@Base 5.0.2+git20140925 + _ZN13KFileMetaData9MimeUtils14strictMimeTypeERK7QStringRK13QMimeDatabase@Base 5.57.0 _ZN13KFileMetaData9WriteData3addENS_8Property8PropertyERK8QVariant@Base 5.22.0 _ZN13KFileMetaData9WriteDataC1ERK7QStringS3_@Base 5.22.0 _ZN13KFileMetaData9WriteDataC1ERKS0_@Base 5.22.0 @@ -111,12 +119,14 @@ libKF5FileMetaData.so.3 libkf5filemetada _ZN13KFileMetaData9WriteDataaSERKS0_@Base 5.22.0 _ZNK13KFileMetaData12PropertyInfo11displayNameEv@Base 5.0.0 _ZNK13KFileMetaData12PropertyInfo15shouldBeIndexedEv@Base 5.0.0 + _ZNK13KFileMetaData12PropertyInfo21formatAsDisplayStringERK8QVariant@Base 5.56.0 _ZNK13KFileMetaData12PropertyInfo4nameEv@Base 5.0.0 _ZNK13KFileMetaData12PropertyInfo8propertyEv@Base 5.0.0 _ZNK13KFileMetaData12PropertyInfo9valueTypeEv@Base 5.0.0 _ZNK13KFileMetaData12PropertyInfoeqERKS0_@Base 5.0.2+git20140925 _ZNK13KFileMetaData12UserMetaData11isSupportedEv@Base 5.1.0.1 _ZNK13KFileMetaData12UserMetaData11userCommentEv@Base 5.1.0.1 + _ZNK13KFileMetaData12UserMetaData15queryAttributesE6QFlagsINS0_9AttributeEE@Base 5.60.0 _ZNK13KFileMetaData12UserMetaData17originEmailSenderEv@Base 5.21.0 _ZNK13KFileMetaData12UserMetaData18originEmailSubjectEv@Base 5.21.0 _ZNK13KFileMetaData12UserMetaData20originEmailMessageIdEv@Base 5.21.0 @@ -126,11 +136,12 @@ libKF5FileMetaData.so.3 libkf5filemetada _ZNK13KFileMetaData12UserMetaData9originUrlEv@Base 5.19.0 _ZNK13KFileMetaData12WriterPlugin10metaObjectEv@Base 5.22.0 _ZNK13KFileMetaData15ExtractorPlugin10metaObjectEv@Base 5.0.0 + _ZNK13KFileMetaData15ExtractorPlugin20getSupportedMimeTypeERK7QString@Base 5.57.0 _ZNK13KFileMetaData16ExtractionResult10inputFlagsEv@Base 5.0.0 _ZNK13KFileMetaData16ExtractionResult13inputMimetypeEv@Base 5.0.0 _ZNK13KFileMetaData16ExtractionResult8inputUrlEv@Base 5.0.0 _ZNK13KFileMetaData16WriterCollection12fetchWritersERK7QString@Base 5.22.0 - _ZNK13KFileMetaData17EmbeddedImageData9imageDataERK7QString6QFlagsINS0_9ImageTypeEE@Base 5.49.0 + _ZNK13KFileMetaData17EmbeddedImageData9imageDataERK7QString6QFlagsINS0_9ImageTypeEE@Base 5.48.0 _ZNK13KFileMetaData17EmbeddedImageData9mimeTypesEv@Base 5.52.0 _ZNK13KFileMetaData19ExtractorCollection15fetchExtractorsERK7QString@Base 5.0.2+git20140925 _ZNK13KFileMetaData22SimpleExtractionResult10propertiesEv@Base 5.0.2+git20140925 @@ -141,19 +152,22 @@ libKF5FileMetaData.so.3 libkf5filemetada _ZNK13KFileMetaData8TypeInfo11displayNameEv@Base 5.0.0 _ZNK13KFileMetaData8TypeInfo4nameEv@Base 5.0.0 _ZNK13KFileMetaData8TypeInfo4typeEv@Base 5.0.2+git20140925 + _ZNK13KFileMetaData9Extractor19extractorPropertiesEv@Base 5.56.0 _ZNK13KFileMetaData9Extractor9mimetypesEv@Base 5.0.2+git20140925 _ZNK13KFileMetaData9WriteData13inputMimetypeEv@Base 5.22.0 _ZNK13KFileMetaData9WriteData16getAllPropertiesEv@Base 5.22.0 _ZNK13KFileMetaData9WriteData8inputUrlEv@Base 5.22.0 _ZNK13KFileMetaData9WriteDataeqERKS0_@Base 5.22.0 - (optional=templinst)_ZNSt8_Rb_treeIKN6TagLib6StringESt4pairIS2_NS0_3APE4ItemEESt10_Select1stIS6_ESt4lessIS2_ESaIS6_EE7_M_copyINSC_11_Alloc_nodeEEEPSt13_Rb_tree_nodeIS6_EPKSG_PSt18_Rb_tree_node_baseRT_@Base 5.49.0 - (optional=templinst)_ZNSt8_Rb_treeIKN6TagLib6StringESt4pairIS2_NS0_3APE4ItemEESt10_Select1stIS6_ESt4lessIS2_ESaIS6_EE8_M_eraseEPSt13_Rb_tree_nodeIS6_E@Base 5.49.0 + (optional=templinst|arch=!ppc64el)_ZNSt6vectorIN13KFileMetaData9ExtractorESaIS1_EE12emplace_backIJS1_EEEvDpOT_@Base 5.57.0 + (optional=templinst)_ZNSt6vectorIN13KFileMetaData9ExtractorESaIS1_EE17_M_realloc_insertIJS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_@Base 5.57.0 + (optional=templinst)_ZNSt8_Rb_treeIKN6TagLib6StringESt4pairIS2_NS0_3APE4ItemEESt10_Select1stIS6_ESt4lessIS2_ESaIS6_EE7_M_copyINSC_11_Alloc_nodeEEEPSt13_Rb_tree_nodeIS6_EPKSG_PSt18_Rb_tree_node_baseRT_@Base 5.48.0 + (optional=templinst)_ZNSt8_Rb_treeIKN6TagLib6StringESt4pairIS2_NS0_3APE4ItemEESt10_Select1stIS6_ESt4lessIS2_ESaIS6_EE8_M_eraseEPSt13_Rb_tree_nodeIS6_E@Base 5.48.0 _ZTIN13KFileMetaData12UserMetaDataE@Base 5.1.0.1 _ZTIN13KFileMetaData12WriterPluginE@Base 5.22.0 _ZTIN13KFileMetaData15ExtractorPluginE@Base 5.0.0 _ZTIN13KFileMetaData16ExtractionResultE@Base 5.0.0 _ZTIN13KFileMetaData16WriterCollectionE@Base 5.22.0 - _ZTIN13KFileMetaData17EmbeddedImageDataE@Base 5.49.0 + _ZTIN13KFileMetaData17EmbeddedImageDataE@Base 5.48.0 _ZTIN13KFileMetaData19ExtractorCollectionE@Base 5.0.2+git20140925 _ZTIN13KFileMetaData22SimpleExtractionResultE@Base 5.0.2+git20140925 _ZTIN13KFileMetaData6WriterE@Base 5.22.0 @@ -164,7 +178,7 @@ libKF5FileMetaData.so.3 libkf5filemetada _ZTSN13KFileMetaData15ExtractorPluginE@Base 5.0.0 _ZTSN13KFileMetaData16ExtractionResultE@Base 5.0.0 _ZTSN13KFileMetaData16WriterCollectionE@Base 5.22.0 - _ZTSN13KFileMetaData17EmbeddedImageDataE@Base 5.49.0 + _ZTSN13KFileMetaData17EmbeddedImageDataE@Base 5.48.0 _ZTSN13KFileMetaData19ExtractorCollectionE@Base 5.0.2+git20140925 _ZTSN13KFileMetaData22SimpleExtractionResultE@Base 5.0.2+git20140925 _ZTSN13KFileMetaData6WriterE@Base 5.22.0 @@ -175,7 +189,7 @@ libKF5FileMetaData.so.3 libkf5filemetada _ZTVN13KFileMetaData15ExtractorPluginE@Base 5.0.0 _ZTVN13KFileMetaData16ExtractionResultE@Base 5.0.0 _ZTVN13KFileMetaData16WriterCollectionE@Base 5.22.0 - _ZTVN13KFileMetaData17EmbeddedImageDataE@Base 5.49.0 + _ZTVN13KFileMetaData17EmbeddedImageDataE@Base 5.48.0 _ZTVN13KFileMetaData19ExtractorCollectionE@Base 5.0.2+git20140925 _ZTVN13KFileMetaData22SimpleExtractionResultE@Base 5.0.2+git20140925 _ZTVN13KFileMetaData6WriterE@Base 5.22.0
  6. Download patch autotests/samplefiles/testexternalwriter/main.py

    --- 5.54.0-1/autotests/samplefiles/testexternalwriter/main.py 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/samplefiles/testexternalwriter/main.py 2019-08-03 19:54:00.000000000 +0000 @@ -1,4 +1,22 @@ #!@PYTHON_EXECUTABLE@ +# +# Copyright (C) 2016 Varun Joshi <varunj.1011@gmail.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) version 3, or any +# later version accepted by the membership of KDE e.V. (or its +# successor approved by the membership of KDE e.V.), which shall +# act as a proxy defined in Section 6 of version 3 of the license. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library. If not, see <https://www.gnu.org/licenses/>. import sys import json Binary files 5.54.0-1/autotests/samplefiles/test.flac and 5.61.0-0ubuntu1/autotests/samplefiles/test.flac differ Binary files 5.54.0-1/autotests/samplefiles/test.mkv and 5.61.0-0ubuntu1/autotests/samplefiles/test.mkv differ
  7. Download patch debian/tests/control

    --- 5.54.0-1/debian/tests/control 2019-01-17 22:26:48.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/tests/control 2019-08-12 09:42:04.000000000 +0000 @@ -1,6 +1,7 @@ Tests: testsuite Depends: @, @builddeps@, build-essential, - xvfb, xauth, dbus (>= 1.8), openbox, libkf5coreaddons-data + xvfb, xauth, dbus (>= 1.8), openbox, + libkf5coreaddons-data Restrictions: build-needed, allow-stderr Tests: acc
  8. Download patch po/sk/kfilemetadata5.po
  9. Download patch autotests/samplefiles/testexternalextractor/main.py

    --- 5.54.0-1/autotests/samplefiles/testexternalextractor/main.py 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/samplefiles/testexternalextractor/main.py 2019-08-03 19:54:00.000000000 +0000 @@ -1,4 +1,22 @@ #!@PYTHON_EXECUTABLE@ +# +# Copyright (C) 2016 Varun Joshi <varunj.1011@gmail.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) version 3, or any +# later version accepted by the membership of KDE e.V. (or its +# successor approved by the membership of KDE e.V.), which shall +# act as a proxy defined in Section 6 of version 3 of the license. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library. If not, see <https://www.gnu.org/licenses/>. import sys import json
  10. Download patch po/sr@ijekavian/kfilemetadata5.po
  11. Download patch autotests/taglibwritertest.h

    --- 5.54.0-1/autotests/taglibwritertest.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/taglibwritertest.h 2019-08-03 19:54:00.000000000 +0000 @@ -23,15 +23,26 @@ #include <QObject> +namespace KFileMetaData { + class ExtractionResult; +} + class TagLibWriterTest : public QObject { Q_OBJECT private: QString testFilePath(const QString& fileName) const; + void extractResult(const QString &mimeType, KFileMetaData::ExtractionResult &result); private Q_SLOTS: void testCommonData(); void testCommonData_data(); + void testExtendedData(); + void testExtendedData_data(); + void testRating(); + void testRating_data(); + void testComplexContactData(); + void testComplexContactData_data(); }; #endif // TAGLIBWRITERTEST_H
  12. Download patch autotests/postscriptdscextractortest.cpp

    --- 5.54.0-1/autotests/postscriptdscextractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/postscriptdscextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -21,6 +21,7 @@ #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/postscriptdscextractor.h" +#include "mimeutils.h" #include <QTest> @@ -35,7 +36,11 @@ void PostscriptDscExtractorTest::testPS( { DscExtractor plugin{this}; - SimpleExtractionResult result(testFilePath("test.ps"), "application/postscript"); + QString fileName = testFilePath(QStringLiteral("test.ps")); + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 1); @@ -55,7 +60,11 @@ void PostscriptDscExtractorTest::testEPS { DscExtractor plugin{this}; - SimpleExtractionResult result(testFilePath("test.eps"), "image/x-eps"); + QString fileName = testFilePath(QStringLiteral("test.eps")); + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 1);
  13. Download patch src/externalextractor.cpp

    --- 5.54.0-1/src/externalextractor.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/src/externalextractor.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -23,6 +23,9 @@ #include "externalextractor.h" #include "kfilemetadata_debug.h" +#include "properties.h" +#include "propertyinfo.h" +#include "typeinfo.h" #include <QDir> #include <QProcess> @@ -30,10 +33,6 @@ #include <QJsonObject> #include <QJsonArray> -#include "properties.h" -#include "propertyinfo.h" -#include "typeinfo.h" - #define EXTRACTOR_TIMEOUT_MS 30000 using namespace KFileMetaData; @@ -54,7 +53,7 @@ ExternalExtractor::ExternalExtractor(QOb } ExternalExtractor::ExternalExtractor(const QString& pluginPath) - : ExtractorPlugin(new QObject()), + : ExtractorPlugin(nullptr), d_ptr(new ExternalExtractorPrivate) { Q_D(ExternalExtractor); @@ -62,10 +61,10 @@ ExternalExtractor::ExternalExtractor(con d->path = pluginPath; QDir pluginDir(pluginPath); - QStringList pluginDirContents = pluginDir.entryList(); + QStringList pluginDirContents = pluginDir.entryList(QDir::Files | QDir::NoDotAndDotDot); if (!pluginDirContents.contains(QStringLiteral("manifest.json"))) { - qCDebug(KFILEMETADATA_LOG) << "Path does not seem to contain a valid plugin"; + qCDebug(KFILEMETADATA_LOG) << pluginPath << "does not seem to contain a valid plugin"; return; } @@ -117,6 +116,13 @@ void ExternalExtractor::extract(Extracti QProcess extractorProcess; extractorProcess.start(d->mainPath, QStringList(), QIODevice::ReadWrite); + bool started = extractorProcess.waitForStarted(); + if (!started) { + qCWarning(KFILEMETADATA_LOG) << "External extractor" << d->mainPath + << "failed to start:" << extractorProcess.errorString(); + return; + } + extractorProcess.write(writeData.toJson()); extractorProcess.closeWriteChannel(); extractorProcess.waitForFinished(EXTRACTOR_TIMEOUT_MS); @@ -125,7 +131,8 @@ void ExternalExtractor::extract(Extracti errorOutput = extractorProcess.readAllStandardError(); if (extractorProcess.exitStatus()) { - qCDebug(KFILEMETADATA_LOG) << errorOutput; + qCWarning(KFILEMETADATA_LOG) << "External extractor" << d->mainPath + << "failed to index" << result->inputUrl() << "-" << errorOutput; return; } @@ -139,24 +146,26 @@ void ExternalExtractor::extract(Extracti QJsonObject rootObject = extractorData.object(); QJsonObject propertiesObject = rootObject[QStringLiteral("properties")].toObject(); - Q_FOREACH(const auto &key, propertiesObject.keys()) { - if (key == QStringLiteral("typeInfo")) { - TypeInfo info = TypeInfo::fromName(propertiesObject.value(key).toString()); + const auto propertiesObjectEnd = propertiesObject.constEnd(); + auto i = propertiesObject.constBegin(); + for (; i != propertiesObjectEnd; ++i) { + if (i.key() == QStringLiteral("typeInfo")) { + TypeInfo info = TypeInfo::fromName(propertiesObject.value(i.key()).toString()); result->addType(info.type()); continue; } // for plaintext extraction - if (key == QStringLiteral("text")) { - result->append(propertiesObject.value(key).toString(QStringLiteral(""))); + if (i.key() == QStringLiteral("text")) { + result->append(propertiesObject.value(i.key()).toString(QStringLiteral(""))); continue; } - PropertyInfo info = PropertyInfo::fromName(key); - if (info.name() != key) { + PropertyInfo info = PropertyInfo::fromName(i.key()); + if (info.name() != i.key()) { continue; } - result->add(info.property(), propertiesObject.value(key).toVariant()); + result->add(info.property(), i.value().toVariant()); } if (rootObject[QStringLiteral("status")].toString() != QStringLiteral("OK")) {
  14. Download patch po/sr@ijekavianlatin/kfilemetadata5.po
  15. Download patch po/de/kfilemetadata5.po
  16. Download patch src/externalwriter.cpp

    --- 5.54.0-1/src/externalwriter.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/src/externalwriter.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -19,6 +19,10 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ + +#include "externalwriter.h" +#include "properties.h" +#include "propertyinfo.h" #include "kfilemetadata_debug.h" #include <QDir> @@ -27,12 +31,6 @@ #include <QJsonObject> #include <QJsonArray> -#include <KLocalizedString> - -#include "externalwriter.h" -#include "properties.h" -#include "propertyinfo.h" - #define WRITER_TIMEOUT_MS 30000 using namespace KFileMetaData; @@ -81,9 +79,9 @@ ExternalWriter::ExternalWriter(const QSt } QJsonObject rootObject = manifestDoc.object(); - QJsonArray mimetypesArray = rootObject.value(QStringLiteral("mimetypes")).toArray(); + const QJsonArray mimetypesArray = rootObject.value(QStringLiteral("mimetypes")).toArray(); QStringList mimetypes; - Q_FOREACH(const QVariant &mimetype, mimetypesArray) { + for (const QVariant &mimetype : mimetypesArray) { mimetypes << mimetype.toString(); } @@ -106,12 +104,12 @@ void ExternalWriter::write(const WriteDa QByteArray output; QByteArray errorOutput; - QMap<Property::Property, QVariant> properties = data.getAllProperties(); - const auto &propertiesKeys = properties.keys(); + const QMap<Property::Property, QVariant> properties = data.getAllProperties(); - Q_FOREACH(const Property::Property &property, propertiesKeys) { - PropertyInfo propertyInfo(property); - propertiesObject[propertyInfo.name()] = QJsonValue::fromVariant(properties[property]); + QMap<Property::Property, QVariant>::const_iterator i = properties.constBegin(); + while (i != properties.constEnd()) { + PropertyInfo propertyInfo(i.key()); + propertiesObject[propertyInfo.name()] = QJsonValue::fromVariant(properties[i.key()]); } rootObject[QStringLiteral("path")] = QJsonValue(data.inputUrl());
  17. Download patch po/gd/kfilemetadata5.po
  18. Download patch autotests/popplerextractortest.cpp

    --- 5.54.0-1/autotests/popplerextractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/popplerextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -22,10 +22,10 @@ #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/popplerextractor.h" +#include "mimeutils.h" -#include <QDebug> #include <QTest> -#include <QDir> +#include <QMimeDatabase> using namespace KFileMetaData; @@ -38,7 +38,12 @@ void PopplerExtractorTest::test() { PopplerExtractor plugin{this}; - SimpleExtractionResult result(testFilePath("test.pdf"), "application/pdf"); + QString fileName = testFilePath(QStringLiteral("test.pdf")); + QMimeDatabase mimeDb; + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 1);
  19. Download patch autotests/mobiextractortest.cpp

    --- 5.54.0-1/autotests/mobiextractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/mobiextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -21,11 +21,12 @@ #include "mobiextractortest.h" #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" -#include "extractors/epubextractor.h" +#include "extractors/mobiextractor.h" +#include "mimeutils.h" -#include <QDebug> #include <QTest> -#include <QDir> +#include <QMimeDatabase> +#include <QMimeType> using namespace KFileMetaData; @@ -36,25 +37,24 @@ QString MobiExtractorTest::testFilePath( void MobiExtractorTest::test() { - EPubExtractor plugin{this}; + MobiExtractor plugin{this}; - SimpleExtractionResult result(testFilePath("test.mobi"), "application/epub+zip"); + QString fileName = testFilePath("test.mobi"); + QMimeDatabase mimeDb; + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 1); QCOMPARE(result.types().first(), Type::Document); - // We're doing a contains instead of an exact check cause the epub file contains - // a ton of css and other garbage. - QVERIFY(result.text().contains(QStringLiteral("This is a sample PDF file for KFileMetaData."))); QCOMPARE(result.properties().value(Property::Author), QVariant(QStringLiteral("Happy Man"))); - QCOMPARE(result.properties().value(Property::Publisher), QVariant(QStringLiteral("Happy Publisher"))); QCOMPARE(result.properties().value(Property::Title), QVariant(QStringLiteral("The Big Brown Bear"))); QCOMPARE(result.properties().value(Property::Subject), QVariant(QStringLiteral("Baloo KFileMetaData"))); - - QDateTime dt(QDate(2014, 1, 1), QTime(1, 1, 1)); - dt.setTimeSpec(Qt::UTC); - QCOMPARE(result.properties().value(Property::CreationDate), QVariant(dt)); + QCOMPARE(result.properties().value(Property::Description), QVariant(QStringLiteral("Honey"))); + QCOMPARE(result.properties().value(Property::Copyright), QVariant(QStringLiteral("License"))); QCOMPARE(result.properties().size(), 5); }
  20. Download patch autotests/exiv2extractortest.cpp

    --- 5.54.0-1/autotests/exiv2extractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/exiv2extractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -22,12 +22,13 @@ #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/exiv2extractor.h" +#include "mimeutils.h" -#include <QDebug> #include <QTest> -#include <QDir> +#include <QMimeDatabase> using namespace KFileMetaData; +using namespace KFileMetaData::Property; QString Exiv2ExtractorTest::testFilePath(const QString& fileName) const { @@ -38,21 +39,48 @@ void Exiv2ExtractorTest::test() { Exiv2Extractor plugin{this}; - SimpleExtractionResult result(testFilePath("test.jpg"), "image/jpeg"); + QString fileName = testFilePath(QStringLiteral("test.jpg")); + QMimeDatabase mimeDb; + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 1); QCOMPARE(result.types().constFirst(), Type::Image); - using namespace KFileMetaData::Property; - - QCOMPARE(result.properties().value(PhotoGpsLatitude).toDouble(), 41.411); - QCOMPARE(result.properties().value(PhotoGpsLongitude).toDouble(), 2.173); - QVERIFY(qAbs(result.properties().value(PhotoGpsAltitude).toDouble() - 12.2) < 0.0001); QCOMPARE(result.properties().value(Artist).toString(), QStringLiteral("Artist")); QCOMPARE(result.properties().value(Description).toString(), QStringLiteral("Description")); QCOMPARE(result.properties().value(Copyright).toString(), QStringLiteral("Copyright")); QCOMPARE(result.properties().value(Generator).toString(), QStringLiteral("digiKam-5.9.0")); } +void Exiv2ExtractorTest::testGPS() +{ + Exiv2Extractor plugin{this}; + + SimpleExtractionResult result(testFilePath("test.jpg"), "image/jpeg"); + plugin.extract(&result); + + QCOMPARE(result.properties().value(PhotoGpsLatitude).toDouble(), 41.411); + QCOMPARE(result.properties().value(PhotoGpsLongitude).toDouble(), 2.173); + QCOMPARE(result.properties().value(PhotoGpsAltitude).toDouble(), 12.2); + + SimpleExtractionResult resultEmpty(testFilePath("test_no_gps.jpg"), "image/jpeg"); + plugin.extract(&resultEmpty); + QVERIFY(!resultEmpty.properties().contains(PhotoGpsLatitude)); + QVERIFY(!resultEmpty.properties().contains(PhotoGpsLongitude)); + QVERIFY(!resultEmpty.properties().contains(PhotoGpsAltitude)); + + SimpleExtractionResult resultZero(testFilePath("test_zero_gps.jpg"), "image/jpeg"); + plugin.extract(&resultZero); + QVERIFY(resultZero.properties().contains(PhotoGpsLatitude)); + QVERIFY(resultZero.properties().contains(PhotoGpsLongitude)); + QVERIFY(resultZero.properties().contains(PhotoGpsAltitude)); + QCOMPARE(resultZero.properties().value(PhotoGpsLatitude).toDouble(), 0.0); + QCOMPARE(resultZero.properties().value(PhotoGpsLongitude).toDouble(), 0.0); + QCOMPARE(resultZero.properties().value(PhotoGpsAltitude).toDouble(), 0.0); +} + QTEST_GUILESS_MAIN(Exiv2ExtractorTest)
  21. Download patch po/sv/kfilemetadata5.po
  22. Download patch debian/control

    --- 5.54.0-1/debian/control 2019-01-17 22:26:48.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/control 2019-08-12 09:42:04.000000000 +0000 @@ -3,38 +3,42 @@ Section: kde Priority: optional Maintainer: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org> Uploaders: Maximiliano Curia <maxy@debian.org> -Build-Depends: cmake (>= 3.5~), +Build-Depends: catdoc, + cmake (>= 3.0~), debhelper (>= 11~), doxygen, - extra-cmake-modules (>= 5.54.0~), + extra-cmake-modules (>= 5.61.0~), graphviz, libattr1-dev, - libavcodec-dev (>= 57.48~), - libavdevice-dev (>= 3.1~), - libavformat-dev (>= 57.40~), + libavcodec-dev, + libavdevice-dev (>= 1.0~), + libavformat-dev, libavutil-dev, libepub-dev, libexiv2-dev (>= 0.21), - libkf5archive-dev (>= 5.54.0~), - libkf5i18n-dev (>= 5.54.0~), + libkf5archive-dev (>= 5.61.0~), + libkf5coreaddons-dev (>= 5.61.0~), + libkf5i18n-dev (>= 5.61.0~), libpoppler-qt5-dev (>= 0.12.1), libpostproc-dev, libqt5sql5-sqlite:native, libswscale-dev, - libtag1-dev (>= 1.11.1~), + libtag1-dev (>= 1.9~), pkg-config, pkg-kde-tools (>= 0.15.18), - qtbase5-dev (>= 5.9.0~), + qtbase5-dev (>= 5.8.0~), + qtmultimedia5-dev, + qttools5-dev, qttools5-dev-tools, Standards-Version: 4.1.4 Homepage: https://projects.kde.org/projects/frameworks/kfilemetadata -Vcs-Browser: https://salsa.debian.org/qt-kde-team/kde/kfilemetadata -Vcs-Git: https://salsa.debian.org/qt-kde-team/kde/kfilemetadata.git +Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/kfilemetadata +Vcs-Git: https://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/kfilemetadata Package: libkf5filemetadata-bin Architecture: any -Depends: catdoc, ${misc:Depends}, ${shlibs:Depends} Multi-Arch: same +Depends: catdoc, ${misc:Depends}, ${shlibs:Depends} Description: library for extracting file metadata This library is for extracting file metadata. . @@ -45,6 +49,7 @@ Description: library for extracting file Package: libkf5filemetadata-data Architecture: all Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} Breaks: kde-l10n (<= 4:4.14.0-1), libkf5filemetadata2 (<< 5.6.0), libkf5filemetadata5 (<< 5.0.0a), @@ -53,22 +58,20 @@ Replaces: kde-l10n (<= 4:4.14.0-1), libkf5filemetadata2 (<< 5.6.0), libkf5filemetadata5 (<< 5.0.0a), ${kde-l10n:all}, -Depends: ${misc:Depends}, ${shlibs:Depends} Description: library for extracting file metadata This library is for extracting file metadata. . kfilemetadata is part of the KDE frameworks. Package: libkf5filemetadata-dev -Section: libdevel Architecture: any +Section: libdevel Depends: libkf5filemetadata3 (= ${binary:Version}), - qtbase5-dev (>= 5.9.0~), + qtbase5-dev (>= 5.8.0~), ${misc:Depends}, ${shlibs:Depends}, Recommends: libkf5filemetadata-doc (= ${source:Version}) Conflicts: libkf5filemetadata1-dev -Breaks: baloo-kf5-dev (<< 5.54) Description: library for extracting file metadata This library is for extracting file metadata. . @@ -79,6 +82,7 @@ Description: library for extracting file Package: libkf5filemetadata-doc Architecture: all Multi-Arch: foreign +Section: doc Depends: ${misc:Depends}, ${shlibs:Depends} Description: library for extracting file metadata (documentation) This library is for extracting file metadata. @@ -86,20 +90,17 @@ Description: library for extracting file kfilemetadata is part of the KDE Plasma desktop. . This package contains the qch documentation files. -Section: doc Package: libkf5filemetadata3 -Section: libs Architecture: any +Multi-Arch: same +Section: libs Depends: libkf5filemetadata-data (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends}, -Breaks: baloo-kf5 (<< 5.54), - libkf5baloo5 (<< 5.54), - libkf5filemetadata2 (<< 5.6.0), -Replaces: libkf5filemetadata2 (<< 5.6.0) -Multi-Arch: same Recommends: libkf5filemetadata-bin (= ${binary:Version}) +Breaks: libkf5filemetadata2 (<< 5.6.0) +Replaces: libkf5filemetadata2 (<< 5.6.0) Description: library for extracting file metadata This library is for extracting file metadata. .
  23. Download patch autotests/samplefiles/test.pl

    --- 5.54.0-1/autotests/samplefiles/test.pl 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/samplefiles/test.pl 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,2 @@ +#! /usr/bin/perl +print("1234\n");
  24. Download patch po/ro/kfilemetadata5.po
  25. Download patch po/ko/kfilemetadata5.po
  26. Download patch autotests/xmlextractortest.cpp

    --- 5.54.0-1/autotests/xmlextractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/xmlextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -21,10 +21,12 @@ #include "xmlextractortest.h" #include <QtTest> +#include <QMimeDatabase> #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/xmlextractor.h" +#include "mimeutils.h" using namespace KFileMetaData; @@ -78,8 +80,12 @@ void XmlExtractorTests::testXmlExtractor { XmlExtractor plugin{this}; - SimpleExtractionResult result(testFilePath(QStringLiteral("test_with_metadata.svg")), - QStringLiteral("image/svg"), + QString fileName = testFilePath(QStringLiteral("test_with_metadata.svg")); + QMimeDatabase mimeDb; + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType, ExtractionResult::ExtractEverything); plugin.extract(&result); @@ -113,5 +119,46 @@ void XmlExtractorTests::testXmlExtractor QVERIFY(result.text().isEmpty()); } +void XmlExtractorTests::testXmlExtractorContainer() +{ + XmlExtractor plugin{this}; + + SimpleExtractionResult result(testFilePath(QStringLiteral("test_with_container.svg")), + QStringLiteral("image/svg"), + ExtractionResult::ExtractEverything); + plugin.extract(&result); + + QString content = QStringLiteral("Some text below <a>\n"); + + QCOMPARE(result.types().size(), 1); + QCOMPARE(result.types().at(0), Type::Image); + + QCOMPARE(result.properties().size(), 0); + + content.replace(QLatin1Char('\n'), QLatin1Char(' ')); + QCOMPARE(result.text(), content); +} + +void XmlExtractorTests::testXmlExtractorMathML() +{ + XmlExtractor plugin{this}; + + SimpleExtractionResult result(testFilePath(QStringLiteral("test.mml")), + QStringLiteral("application/mathml+xml"), + ExtractionResult::ExtractEverything); + plugin.extract(&result); + + QString content = QStringLiteral("1 + 1 = 2\n"); + + QCOMPARE(result.types().size(), 1); + QCOMPARE(result.types().at(0), Type::Text); + + QCOMPARE(result.properties().size(), 0); + + content.replace(QLatin1Char('\n'), QLatin1Char(' ')); + QCOMPARE(result.text(), content); +} + + QTEST_GUILESS_MAIN(XmlExtractorTests)
  27. Download patch po/nds/kfilemetadata5.po
  28. Download patch po/id/kfilemetadata5.po
  29. Download patch autotests/usermetadatawritertest.cpp

    --- 5.54.0-1/autotests/usermetadatawritertest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/usermetadatawritertest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -21,9 +21,7 @@ #include "indexerextractortestsconfig.h" #include "usermetadata.h" -#include <QDebug> #include <QTest> -#include <QDir> #include <QFile> #define TEST_FILENAME "writertest.txt" @@ -51,14 +49,23 @@ void UserMetaDataWriterTest::test() // Tags md.setTags(QStringList() << QStringLiteral("this/is/a/test/tag")); QCOMPARE(md.tags().at(0), QStringLiteral("this/is/a/test/tag")); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::Any) & UserMetaData::Attribute::Tags); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::All) & UserMetaData::Attribute::Tags); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::Tags) & UserMetaData::Attribute::Tags); + QVERIFY(!(md.queryAttributes(UserMetaData::Attribute::Rating) & UserMetaData::Attribute::Tags)); md.setTags(QStringList()); QVERIFY(!md.hasAttribute(QStringLiteral("xdg.tags"))); + QVERIFY(!(md.queryAttributes(UserMetaData::Attribute::Tags) & UserMetaData::Attribute::Tags)); // Rating md.setRating(3); QCOMPARE(md.rating(), 3); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::All) & UserMetaData::Attribute::Rating); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::Rating) & UserMetaData::Attribute::Rating); md.setRating(0); QVERIFY(!md.hasAttribute(QStringLiteral("baloo.rating"))); + QVERIFY(!(md.queryAttributes(UserMetaData::Attribute::All) & UserMetaData::Attribute::Rating)); + QVERIFY(!(md.queryAttributes(UserMetaData::Attribute::Rating) & UserMetaData::Attribute::Rating)); // Comment md.setUserComment(QStringLiteral("this is a test comment")); @@ -93,8 +100,23 @@ void UserMetaDataWriterTest::test() // Attribute md.setAttribute(QStringLiteral("test.attribute"), QStringLiteral("attribute")); QCOMPARE(md.attribute(QStringLiteral("test.attribute")), QStringLiteral("attribute")); + md.setAttribute(QStringLiteral("test.attribute2"), QStringLiteral("attribute2")); + QCOMPARE(md.attribute(QStringLiteral("test.attribute2")), QStringLiteral("attribute2")); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::All) & UserMetaData::Attribute::Other); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::Other) & UserMetaData::Attribute::Other); md.setAttribute(QStringLiteral("test.attribute"), QString()); QVERIFY(!md.hasAttribute(QStringLiteral("test.attribute"))); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::All) & UserMetaData::Attribute::Other); + QVERIFY(md.queryAttributes(UserMetaData::Attribute::Other) & UserMetaData::Attribute::Other); + md.setAttribute(QStringLiteral("test.attribute2"), QString()); + QVERIFY(!md.hasAttribute(QStringLiteral("test.attribute2"))); + + // Check for side effects of calling sequence + QVERIFY(!md.hasAttribute(QStringLiteral("test.check_contains"))); + md.setAttribute(QStringLiteral("test.check_contains"), QStringLiteral("dummy")); + QVERIFY(md.hasAttribute(QStringLiteral("test.check_contains"))); + md.setAttribute(QStringLiteral("test.check_contains"), QString()); + QVERIFY(!md.hasAttribute(QStringLiteral("test.check_contains"))); } void UserMetaDataWriterTest::cleanupTestCase()
  30. Download patch po/ca@valencia/kfilemetadata5.po
  31. Download patch autotests/taglibextractortest.cpp
  32. Download patch po/ru/kfilemetadata5.po
  33. Download patch autotests/xmlextractortest.h

    --- 5.54.0-1/autotests/xmlextractortest.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/xmlextractortest.h 2019-08-03 19:54:00.000000000 +0000 @@ -37,6 +37,8 @@ private Q_SLOTS: void benchMarkXmlExtractor(); void testXmlExtractor(); void testXmlExtractorNoContent(); + void testXmlExtractorContainer(); + void testXmlExtractorMathML(); }; #endif // XMLEXTRACTORTESTS_H
  34. Download patch CMakeLists.txt

    --- 5.54.0-1/CMakeLists.txt 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/CMakeLists.txt 2019-08-03 19:54:00.000000000 +0000 @@ -1,15 +1,15 @@ cmake_minimum_required(VERSION 3.5) -set(KF5_VERSION "5.54.0") # handled by release scripts -set(KF5_DEP_VERSION "5.54.0") # handled by release scripts +set(KF5_VERSION "5.61.0") # handled by release scripts +set(KF5_DEP_VERSION "5.61.0") # handled by release scripts project(KFileMetaData VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.54.0 NO_MODULE) +find_package(ECM 5.61.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH}) include(KDEInstallDirs) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) @@ -31,7 +31,12 @@ ecm_setup_version(PROJECT SOVERSION 3) # Dependencies -set(REQUIRED_QT_VERSION 5.9.0) +set(REQUIRED_QT_VERSION 5.11.0) + +find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG COMPONENTS Gui) +set_package_properties(Qt5Gui PROPERTIES DESCRIPTION "Qt 5: Gui component" + TYPE OPTIONAL + PURPOSE "Qt5::Gui is needed to build the AppImage extractor") find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Xml) @@ -40,16 +45,26 @@ set_package_properties(KF5Archive PROPER URL "https://download.kde.org/stable/frameworks/" TYPE OPTIONAL PURPOSE "Archive is needed to build ODF and OOXML 2007 extractors") +find_package(KF5 ${KF5_DEP_VERSION} COMPONENTS CoreAddons) +set_package_properties(KF5CoreAddons PROPERTIES DESCRIPTION "KDE Frameworks 5: Core Addons Framework" + URL "https://download.kde.org/stable/frameworks/" TYPE REQUIRED + PURPOSE "Needed for the formatting of properties for display purposes") + +find_package(KF5 ${KF5_DEP_VERSION} COMPONENTS Config) +set_package_properties(KF5Config PROPERTIES DESCRIPTION "KDE Frameworks 5: Config Framework" + URL "https://download.kde.org/stable/frameworks/" TYPE OPTIONAL + PURPOSE "Config is needed to build the AppImage extractor") + find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS I18n) find_package(Poppler 0.12.1 COMPONENTS Qt5) set_package_properties(Poppler PROPERTIES DESCRIPTION "A PDF rendering library" - URL "http://poppler.freedesktop.org" TYPE OPTIONAL + URL "https://poppler.freedesktop.org/" TYPE OPTIONAL PURPOSE "Support for PDF files") find_package(Taglib 1.11.1) set_package_properties(Taglib PROPERTIES DESCRIPTION "Id3 tag reader" - URL "http://developer.kde.org/~wheeler/taglib.html" TYPE OPTIONAL + URL "https://taglib.org/" TYPE OPTIONAL PURPOSE "Support for music metadata") find_package(LibExiv2 0.21) @@ -61,7 +76,7 @@ find_package(FFmpeg 57.48 COMPONENTS AVC find_package(FFmpeg 57.40 COMPONENTS AVFORMAT) find_package(FFmpeg 55.27 COMPONENTS AVUTIL) set_package_properties(FFmpeg PROPERTIES DESCRIPTION "Video Tag reader" - URL "http://ffmpeg.org" TYPE OPTIONAL + URL "https://ffmpeg.org/" TYPE OPTIONAL PURPOSE "Support for video metadata") if (FFmpeg_AVFORMAT_FOUND) @@ -71,29 +86,36 @@ endif() find_package(EPub) set_package_properties(EPub PROPERTIES DESCRIPTION "Ebook epub reader" - URL "http://sourceforge.net/projects/ebook-tools" TYPE OPTIONAL + URL "https://sourceforge.net/projects/ebook-tools/" TYPE OPTIONAL PURPOSE "Support for epub metadata") find_package(CatDoc) set_package_properties(CatDoc PROPERTIES DESCRIPTION "catdoc executable" - URL "http://www.wagner.pp.ru/~vitus/software/catdoc/" TYPE RUNTIME + URL "https://www.wagner.pp.ru/~vitus/software/catdoc/" TYPE RUNTIME PURPOSE "Extract text from office 98 files - RUNTIME dependency") if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) find_package(Xattr) set_package_properties(Xattr PROPERTIES DESCRIPTION "library libattr " - URL "http://savannah.nongnu.org/projects/attr" + URL "https://savannah.nongnu.org/projects/attr" TYPE REQUIRED PURPOSE "Extended attribute shared library") endif() -#find_package(QMobipocket) +#find_package(QMobipocket 2.0) #set_package_properties(QMobipocket PROPERTIES DESCRIPTION "Mobipocket epub reader" -# URL "https://projects.kde.org/projects/kde/kdegraphics/kdegraphics-mobipocket" +# URL "https://cgit.kde.org/kdegraphics-mobipocket.git" # TYPE OPTIONAL PURPOSE "Support for mobi metadata") -add_definitions(-DTRANSLATION_DOMAIN=\"kfilemetadata5\") +find_package(libappimage 0.1.10 CONFIG) +set_package_properties(libappimage PROPERTIES DESCRIPTION "Core library of the AppImage project" + URL "https://github.com/AppImage/libappimage" + TYPE OPTIONAL + PURPOSE "Needed to build the AppImage extractor" + ) +add_definitions(-DTRANSLATION_DOMAIN=\"kfilemetadata5\") +add_definitions(-DQT_NO_FOREACH) add_subdirectory(src) if (BUILD_TESTING) add_subdirectory(autotests) @@ -133,5 +155,5 @@ install(FILES ) # contains list of debug categories, for kdebugsettings -install(FILES kfilemetadata.categories DESTINATION ${KDE_INSTALL_CONFDIR}) +install(FILES kfilemetadata.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
  35. Download patch autotests/appimageextractortest.h

    --- 5.54.0-1/autotests/appimageextractortest.h 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/appimageextractortest.h 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2019 Friedrich W. H. Kossebau <kossebau@kde.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef APPIMAGEEXTRACTORTEST_H +#define APPIMAGEEXTRACTORTEST_H + +#include <QObject> + +class AppImageExtractorTest : public QObject +{ + Q_OBJECT +private: + QString testFilePath(const QString& fileName) const; + +private Q_SLOTS: + void test(); +}; + +#endif
  36. Download patch po/fi/kfilemetadata5.po
  37. Download patch autotests/office2007extractortest.cpp

    --- 5.54.0-1/autotests/office2007extractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/office2007extractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -22,10 +22,10 @@ #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/office2007extractor.h" +#include "mimeutils.h" -#include <QDebug> #include <QTest> -#include <QDir> +#include <QMimeDatabase> using namespace KFileMetaData; @@ -38,7 +38,12 @@ void Office2007ExtractorTest::test() { Office2007Extractor plugin{this}; - SimpleExtractionResult result(testFilePath(QStringLiteral("test_libreoffice.docx")), QStringLiteral("application/vnd.openxmlformats-officedocument.wordprocessingml.document")); + QString fileName = testFilePath(QStringLiteral("test_libreoffice.docx")); + QMimeDatabase mimeDb; + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 1);
  38. Download patch autotests/odfextractortest.cpp

    --- 5.54.0-1/autotests/odfextractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/odfextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -22,12 +22,11 @@ #include "odfextractortest.h" #include <QTest> -#include <QDir> -#include <QDebug> #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/odfextractor.h" +#include "mimeutils.h" using namespace KFileMetaData; @@ -40,7 +39,11 @@ void OdfExtractorTest::testText() { OdfExtractor plugin{this}; - SimpleExtractionResult result(testFilePath(QStringLiteral("test.odt")), QStringLiteral("application/vnd.oasis.opendocument.text")); + QString fileName = testFilePath(QStringLiteral("test.odt")); + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 1); @@ -77,7 +80,11 @@ void OdfExtractorTest::testPresentation( { OdfExtractor plugin{this}; - SimpleExtractionResult result(testFilePath(QStringLiteral("test.odp")), QStringLiteral("application/vnd.oasis.opendocument.presentation")); + QString fileName = testFilePath(QStringLiteral("test.odp")); + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 2);
  39. Download patch metainfo.yaml

    --- 5.54.0-1/metainfo.yaml 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/metainfo.yaml 2019-08-03 19:54:00.000000000 +0000 @@ -1,4 +1,4 @@ -maintainer: mgallien +maintainer: bruns description: A file metadata and text extraction library tier: 2 type: integration
  40. Download patch .gitignore

    --- 5.54.0-1/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/.gitignore 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,22 @@ +# Ignore the following files +*~ +*.[oa] +*.diff +*.kate-swp +*.kdev4 +.kdev_include_paths +*.kdevelop.pcs +*.moc +*.moc.cpp +*.orig +*.user +.*.swp +.swp.* +Doxyfile +Makefile +avail +random_seed +/build*/ +CMakeLists.txt.user* +*.unc-backup* +*.rej
  41. Download patch autotests/externalextractortest.cpp

    --- 5.54.0-1/autotests/externalextractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/externalextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -24,9 +24,7 @@ #include "externalextractor.h" #include "config-kfilemetadata.h" -#include <QDebug> #include <QTest> -#include <QDir> #include <QTemporaryFile> using namespace KFileMetaData;
  42. Download patch autotests/extractorcollectiontest.cpp

    --- 5.54.0-1/autotests/extractorcollectiontest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/extractorcollectiontest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -25,7 +25,7 @@ #include "extractorcollection.h" -using namespace KFileMetaData; +namespace KFileMetaData { class ExtractorCollectionTest : public QObject { @@ -86,8 +86,63 @@ private Q_SLOTS: QVERIFY(!xmlSubtypeExtractors.contains(extractor)); } } + + void testExtractorMetadata() + { + QCoreApplication::setLibraryPaths({QCoreApplication::applicationDirPath()}); + ExtractorCollection collection; + + auto allExtractors = collection.allExtractors(); + + for (auto extractor : allExtractors) { + auto exProperties = extractor->extractorProperties(); + if (exProperties.isEmpty()) { + qWarning() << "Extractor has no property data, please add it! - (Extractor mimetypes:" + << extractor->mimetypes().join(", ") + ')'; + continue; + } + + // Verify properties for every supported mimetype + auto propMimetypesJson = exProperties["MimeTypes"]; + QSet<QString> propMimetypes = propMimetypesJson.toMap().keys().toSet(); + QSet<QString> supportedMimetypes = extractor->mimetypes().toSet(); + + QVERIFY2(!exProperties["Name"].toString().isEmpty(), "Missing \"Name\" property"); + QVERIFY2(!exProperties["Id"].toString().isEmpty(), "Missing \"Id\" property"); + + if (propMimetypes == supportedMimetypes) { + continue; + } + + auto diff = propMimetypes - supportedMimetypes; + if (!diff.isEmpty()) { + for (auto mimetype : diff.toList()) { + auto mimetypeProp = propMimetypesJson.toMap()[mimetype]; + auto runtimedep = mimetypeProp.toMap()["HasRuntimeDependency"]; + if (runtimedep.isValid() && runtimedep.toInt()) { + diff.remove(mimetype); + } + } + + if (!diff.isEmpty()) { + qWarning() << exProperties["Name"].toString() + << exProperties["Id"].toString() + << "has extraneous properties for these mimetypes:" << diff.toList().join(", "); + } + } + + diff = supportedMimetypes - propMimetypes; + if (!diff.isEmpty()) { + qWarning() << exProperties["Name"].toString() + << exProperties["Id"].toString() + << "has no properties for these mimetypes:" + diff.toList().join(", "); + } + } + } }; -QTEST_GUILESS_MAIN(ExtractorCollectionTest) +} + +QTEST_GUILESS_MAIN(KFileMetaData::ExtractorCollectionTest) #include "extractorcollectiontest.moc"
  43. Download patch debian/libkf5filemetadata-data.install

    --- 5.54.0-1/debian/libkf5filemetadata-data.install 2019-01-17 22:26:48.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/libkf5filemetadata-data.install 2019-08-12 09:42:04.000000000 +0000 @@ -1,2 +1,2 @@ -etc/ -usr/share/locale/*/*/kfilemetadata*.mo +usr/share/locale/ +usr/share/qlogging-categories5/
  44. Download patch autotests/appimageextractortest.cpp

    --- 5.54.0-1/autotests/appimageextractortest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/appimageextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2019 Friedrich W. H. Kossebau <kossebau@kde.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "appimageextractortest.h" + +// Qt +#include <QTest> + +#include "simpleextractionresult.h" +#include "indexerextractortestsconfig.h" +#include "extractors/appimageextractor.h" + +using namespace KFileMetaData; + +QString AppImageExtractorTest::testFilePath(const QString& fileName) const +{ + return QLatin1String(INDEXER_TESTS_SAMPLE_FILES_PATH) + QLatin1Char('/') + fileName; +} + +/* +The test.AppImage got created by: + +wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage +chmod +x linuxdeploy-x86_64.AppImage +./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage --executable=/usr/bin/echo --desktop-file=appimagetest.desktop --icon-file=/usr/share/icons/oxygen/base/16x16/apps/kde.png +mkdir AppDir/usr/share/metainfo/ +cp org.kde.kfilemetadata.appimagetest.appdata.xml AppDir/usr/share/metainfo/ +./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage +mv Test_Desktop_Name-x86_64.AppImage test.AppImage + +To edit the appdata.xml & desktop file, run ./test.AppImage --appimage-extract to get the files. +Use linuxdeploy to create the appimage then again. +*/ + +void AppImageExtractorTest::test() +{ + AppImageExtractor plugin{this}; + + SimpleExtractionResult result(testFilePath(QStringLiteral("test.AppImage")), QStringLiteral("application/vnd.appimage")); + plugin.extract(&result); + + QCOMPARE(result.types().size(), 0); + + QCOMPARE(result.properties().value(Property::Author), QVariant(QStringLiteral("Konqi"))); + QCOMPARE(result.properties().value(Property::Title), QVariant(QStringLiteral("Test Desktop Name"))); + QCOMPARE(result.properties().value(Property::Comment), QVariant(QStringLiteral("Test Desktop Comment"))); + QCOMPARE(result.properties().value(Property::Description), QVariant(QStringLiteral("Test description line 1.\nTest description line 2."))); + QCOMPARE(result.properties().value(Property::License), QVariant(QStringLiteral("GPL-2.0"))); + +} + +QTEST_GUILESS_MAIN(AppImageExtractorTest)
  45. Download patch po/nb/kfilemetadata5.po
  46. Download patch autotests/samplefiles/test_apple_systemprofiler.spx

    --- 5.54.0-1/autotests/samplefiles/test_apple_systemprofiler.spx 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/samplefiles/test_apple_systemprofiler.spx 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<array> +<!-- Incomplete file, used to test for extension mismatch vs Speex *.spx --> +</array> +</plist>
  47. Download patch autotests/externalwritertest.cpp

    --- 5.54.0-1/autotests/externalwritertest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/externalwritertest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -24,9 +24,7 @@ #include "externalwriter.h" #include "config-kfilemetadata.h" -#include <QDebug> #include <QTest> -#include <QDir> #include <QTemporaryFile> using namespace KFileMetaData;
  48. Download patch po/pt/kfilemetadata5.po
  49. Download patch autotests/samplefiles/test_with_container.svg

    --- 5.54.0-1/autotests/samplefiles/test_with_container.svg 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/samplefiles/test_with_container.svg 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns="http://www.w3.org/2000/svg" + version="1.0"> + <a href="test_with_metadata.svg"> + <text>Some text below &lt;a&gt;</text> + </a> +</svg> + Binary files 5.54.0-1/autotests/samplefiles/test_zero_gps.jpg and 5.61.0-0ubuntu1/autotests/samplefiles/test_zero_gps.jpg differ
  50. Download patch autotests/propertyinfotest.cpp

    --- 5.54.0-1/autotests/propertyinfotest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/propertyinfotest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -25,6 +25,33 @@ using namespace KFileMetaData; +//QTEST_GUILESS_MAIN(PropertyInfoTest) +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + PropertyInfoTest tc; + + auto arguments = app.arguments(); + if (arguments.contains(QStringLiteral("--localized"))) { + arguments.removeAll(QStringLiteral("--localized")); + tc.setLocalized(true); + } + + return QTest::qExec(&tc, arguments); +} + +void PropertyInfoTest::setLocalized(bool localized) +{ + m_useLocalization = localized; +} + +void PropertyInfoTest::init() +{ + if (!m_useLocalization) { + QLocale().setDefault(QLocale(QLocale::English, QLocale::UnitedStates)); + } +} + void PropertyInfoTest::testNameIdMapping() { // The +1 is to avoid the Empty Property @@ -45,4 +72,91 @@ void PropertyInfoTest::testNameIdMapping } } -QTEST_GUILESS_MAIN(PropertyInfoTest) +void PropertyInfoTest::testFormatAsDisplayString() { + QFETCH(KFileMetaData::PropertyInfo, propertyInfo); + QFETCH(QVariant, value); + QFETCH(QString, expected); + QFETCH(bool, maybeLocalized); + + if (m_useLocalization && maybeLocalized) { + qDebug() << "Expected:" << expected << ", formatted/localized:" << propertyInfo.formatAsDisplayString(value); + if (expected != propertyInfo.formatAsDisplayString(value)) { + QEXPECT_FAIL("", "Expected value not localized", Continue); + } + } + QCOMPARE(propertyInfo.formatAsDisplayString(value), expected); +} + +void PropertyInfoTest::testFormatAsDisplayString_data() +{ + QTest::addColumn<KFileMetaData::PropertyInfo>("propertyInfo"); + QTest::addColumn<QVariant>("value"); + // expected values for an en_US locale + QTest::addColumn<QString>("expected"); + QTest::addColumn<bool>("maybeLocalized"); + + auto emptyProperty = PropertyInfo::fromName(QStringLiteral("no valid property name")); + QTest::addRow("<invalid>") + << emptyProperty << QVariant(QStringLiteral("empty")) << QStringLiteral("empty") << true; + + QStringList artistList = {QStringLiteral("Artist1"), QStringLiteral("Artist2"), QStringLiteral("Artist3")}; + QStringList authorList = {QStringLiteral("Author1")}; + QVariantList arrangerList = {QStringLiteral("Arranger1"), QStringLiteral("Arranger2")}; + QVariantList bitRateList = {128000, 130000}; + QVariantList titleList = {QStringLiteral("Title1"), QStringLiteral("Title2")}; + + struct { + KFileMetaData::Property::Property property; + bool maybeLocalized; + QVariant value; + QString expected; + } rows[] = { + { Property::DiscNumber, true, 2018, QStringLiteral("2018")}, + { Property::Title, false, QStringLiteral("Title"), QStringLiteral("Title")}, + { Property::Title, false, titleList, QStringLiteral("Title1 and Title2")}, + { Property::Artist, true, artistList, QStringLiteral("Artist1, Artist2, and Artist3")}, + { Property::Author, true, authorList, QStringLiteral("Author1")}, + { Property::Arranger, true, arrangerList, QStringLiteral("Arranger1 and Arranger2")}, + { Property::Duration, true, 1800, QStringLiteral("0:30:00")}, + { Property::SampleRate, true, 44100, QStringLiteral("44.1 kHz")}, + { Property::BitRate, true, 128000, QStringLiteral("128 kbit/s")}, + { Property::BitRate, true, 1350000, QStringLiteral("1.35 Mbit/s")}, + { Property::BitRate, true, 14700000, QStringLiteral("14.7 Mbit/s")}, + { Property::BitRate, true, bitRateList, QStringLiteral("128 kbit/s and 130 kbit/s")}, + { Property::ImageOrientation, true, 5, QStringLiteral("Transposed")}, + { Property::PhotoFlash, true, 0x00, QStringLiteral("No flash")}, + { Property::PhotoFlash, true, 0x50, QStringLiteral("No, red-eye reduction")}, + { Property::PhotoGpsAltitude, true, 1.1, QStringLiteral("1.1 m")}, + // make VisualStudio compiler happy: QChar(0x00B0) = "°" + { Property::PhotoGpsLatitude, true, 25, QStringLiteral("25") + QChar(0x00B0)}, + { Property::PhotoGpsLongitude, true, 13.5, QStringLiteral("13.5") + QChar(0x00B0)}, + { Property::PhotoExposureTime, true, 0.0015625, QStringLiteral("1/640 s")}, + { Property::PhotoExposureTime, true, 0.5, QStringLiteral("0.5 s")}, + { Property::PhotoExposureTime, true, 0.15, QStringLiteral("0.15 s")}, + { Property::PhotoExposureBiasValue, true, 0.33333, QStringLiteral("1/3 EV")}, + { Property::PhotoExposureBiasValue, true, 0.66667, QStringLiteral("2/3 EV")}, + { Property::PhotoExposureBiasValue, true, 1, QStringLiteral("1 EV")}, + { Property::PhotoExposureBiasValue, true, 1.66667, QStringLiteral("1 2/3 EV")}, + { Property::PhotoExposureBiasValue, true, 0.1888, QStringLiteral("0.189 EV")}, + { Property::PhotoExposureBiasValue, true, -0.33333, QStringLiteral("-1/3 EV")}, + { Property::PhotoExposureBiasValue, true, 0, QStringLiteral("0 EV")}, + { Property::PhotoExposureBiasValue, true, -1.5, QStringLiteral("-1 1/2 EV")}, + { Property::PhotoFNumber, true, 4.0, QStringLiteral("f/4")}, + { Property::PhotoFNumber, true, 2.8, QStringLiteral("f/2.8")}, + { Property::ReplayGainAlbumGain, true, -9.90, QStringLiteral("-9.9")}, + { Property::ReplayGainAlbumPeak, true, 1.512, QStringLiteral("1.51")}, + { Property::ReplayGainAlbumGain, true, 10.44, QStringLiteral("10.4")}, + { Property::ReplayGainAlbumPeak, true, 1.306, QStringLiteral("1.31")}, + { Property::FrameRate, true, 23, QStringLiteral("23 fps")}, + { Property::FrameRate, true, 23.976, QStringLiteral("23.98 fps")}, + { Property::AspectRatio, true, 1.77778, QStringLiteral("1.78:1")}, + { Property::PhotoFocalLength, true, 2.0, QStringLiteral("2 mm")}, + { Property::PhotoFocalLength, true, 2.4, QStringLiteral("2.4 mm")}, + }; + + for (auto row : rows) { + PropertyInfo info(row.property); + QTest::addRow("%s", info.displayName().toUtf8().constData()) + << info << row.value << row.expected << row.maybeLocalized; + } +}
  51. Download patch po/ja/kfilemetadata5.po
  52. Download patch po/it/kfilemetadata5.po
  53. Download patch autotests/taglibextractortest.h

    --- 5.54.0-1/autotests/taglibextractortest.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/taglibextractortest.h 2019-08-03 19:54:00.000000000 +0000 @@ -23,6 +23,7 @@ #define TAGLIBEXTRACTORTEST_H #include <QObject> +#include <QMimeDatabase> #include "properties.h" class TagLibExtractorTest : public QObject @@ -32,10 +33,13 @@ private: QString testFilePath(const QString& fileName) const; private Q_SLOTS: + void testPropertyTypes(); void testCommonData(); void testCommonData_data(); void testVorbisComment(); void testVorbisComment_data(); + void testVorbisCommentMultivalue(); + void testVorbisCommentMultivalue_data(); void testId3(); void testId3_data(); void testApe(); @@ -50,10 +54,13 @@ private Q_SLOTS: void testWmaRating(); void testNoMetadata(); void testNoMetadata_data(); + void testRobustness(); + void testRobustness_data(); private: // Convenience function const QStringList propertyEnumNames(const QList<KFileMetaData::Property::Property>& key) const; + QMimeDatabase mimeDb; }; #endif // TAGLIBEXTRACTORTEST_H
  54. Download patch po/lt/kfilemetadata5.po
  55. Download patch po/ca/kfilemetadata5.po
  56. Download patch po/eu/kfilemetadata5.po
  57. Download patch debian/patches/series

    --- 5.54.0-1/debian/patches/series 2019-01-17 22:26:48.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/patches/series 2019-08-12 09:42:04.000000000 +0000 @@ -1 +1,2 @@ usermetadatawritertest-skip-if-xattr-is-not-supported.patch +fix-propertyinfotest.patch
  58. Download patch po/zh_CN/kfilemetadata5.po
  59. Download patch po/pa/kfilemetadata5.po
  60. Download patch po/et/kfilemetadata5.po
  61. Download patch po/nn/kfilemetadata5.po
  62. Download patch po/hu/kfilemetadata5.po
  63. Download patch po/ia/kfilemetadata5.po
  64. Download patch autotests/extractorcoveragetest.cpp

    --- 5.54.0-1/autotests/extractorcoveragetest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/extractorcoveragetest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,155 @@ +/* + * This file is part of the KDE KFileMetaData project + * Copyright (C) 2014 Vishesh Handa <me@vhanda.in> + * 2017 Igor Poboiko <igor.poboiko@gmail.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include <QObject> +#include <QtTest> +#include <QMimeDatabase> + +#include "mimeutils.h" + +#include "indexerextractortestsconfig.h" + +namespace KFileMetaData { + +class ExtractorCoverageTest : public QObject +{ + Q_OBJECT + +private: + static QString filePath() { + return QLatin1String(INDEXER_TESTS_SAMPLE_FILES_PATH); + } + + QStringList m_testFiles; + QMap<QString, QString> m_knownFiles; + +private Q_SLOTS: + + void initTestCase() { + // Expected mimetypes + m_knownFiles = { + { "test.aif", "audio/x-aifc"}, + { "test.ape", "audio/x-ape"}, + { "test.AppImage", "application/vnd.appimage"}, + { "test_apple_systemprofiler.spx", "application/xml"}, + { "test.dot", "text/vnd.graphviz"}, + { "test.eps", "image/x-eps"}, + { "test.epub", "application/epub+zip"}, + { "test.flac", "audio/flac"}, + { "test.jpg", "image/jpeg"}, + { "test_libreoffice.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"}, + { "test.m4a", "audio/mp4"}, + { "test_missing_content.odt", "application/vnd.oasis.opendocument.text"}, + { "test_missing_meta.odt", "application/vnd.oasis.opendocument.text"}, + { "test.mkv", "video/x-matroska"}, + { "test.mp3", "audio/mpeg"}, + { "test.mpc", "audio/x-musepack"}, + { "test_no_gps.jpg", "image/jpeg"}, + { "test.odp", "application/vnd.oasis.opendocument.presentation"}, + { "test.odt", "application/vnd.oasis.opendocument.text"}, + { "test.ogg", "audio/x-vorbis+ogg"}, + { "test.mml", "application/mathml+xml"}, + { "test_multivalue.ogg", "audio/x-vorbis+ogg"}, + { "test.ogv", "video/x-theora+ogg"}, + { "test.opus", "audio/x-opus+ogg"}, + { "test.pdf", "application/pdf"}, + { "test.pl", "application/x-perl"}, + { "test.ps", "application/postscript"}, + { "test_public_key.gpg", "application/pgp-encrypted"}, + { "test.spx", "audio/x-speex+ogg"}, + { "test.ts", "video/mp2t"}, + { "test.wav", "audio/x-wav"}, + { "test.webm", "video/webm"}, + { "test_with_container.svg", "image/svg+xml"}, + { "test_with_metadata.svg", "image/svg+xml"}, + { "test.wma", "audio/x-ms-wma"}, + { "test.wv", "audio/x-wavpack"}, + { "test_zero_gps.jpg", "image/jpeg"}, + { "test.mobi", "application/x-mobipocket-ebook"}, + }; + + // Collect all test files from the samplefiles directory + QDirIterator it(filePath(), {QStringLiteral("test*")}, QDir::Files); + while (it.hasNext()) { + it.next(); + m_testFiles.append(it.fileName()); + } + } + + void testMimetype_data() + { + /* + * Check if we get the correct mimetype for + * each available test sample + */ + QTest::addColumn<QString>("fileName"); + QTest::addColumn<QString>("mimeType"); + + auto it = m_knownFiles.cbegin(); + while (it != m_knownFiles.cend()) { + QTest::addRow("%s", it.key().toUtf8().constData()) + << it.key() << it.value(); + ++it; + } + } + + void testMimetype() + { + QFETCH(QString, fileName); + QFETCH(QString, mimeType); + QString url = filePath() + QChar('/') + fileName; + + QMimeDatabase db; + auto fileMime = MimeUtils::strictMimeType(url, db); + + QVERIFY(fileMime.isValid()); + QCOMPARE(fileMime.name(), mimeType); + } + + void testFileCoverage_data() + { + /* + * Check if we get the correct mimetype for + * each available test sample + */ + QTest::addColumn<QString>("fileName"); + + auto it = m_testFiles.cbegin(); + while (it != m_testFiles.cend()) { + QTest::addRow("%s", it->toUtf8().constData()) << (*it); + ++it; + } + } + + void testFileCoverage() + { + QFETCH(QString, fileName); + + QVERIFY2(m_knownFiles.contains(fileName), "test file omitted from test suite"); + } + +}; + +} + +QTEST_GUILESS_MAIN(KFileMetaData::ExtractorCoverageTest) + +#include "extractorcoveragetest.moc"
  65. Download patch autotests/samplefiles/test.dot

    --- 5.54.0-1/autotests/samplefiles/test.dot 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/samplefiles/test.dot 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,2 @@ +# some comment +/graph{}
  66. Download patch autotests/ffmpegextractortest.h

    --- 5.54.0-1/autotests/ffmpegextractortest.h 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/ffmpegextractortest.h 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2019 Alexander Stippich <a.stippich@gmx.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef FFMPEGEXTRACTORTEST_H +#define FFMPEGEXTRACTORTEST_H + +#include <QObject> +#include <QMimeDatabase> + +namespace KFileMetaData { + +class ffmpegExtractorTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testVideoProperties(); + void testVideoProperties_data(); + void testMetaData(); + void testMetaData_data(); + +private: + QMimeDatabase mimeDb; +}; +} // namespace KFileMetaData + +#endif // FFMPEGEXTRACTORTEST_H
  67. Download patch autotests/propertyinfotest.h

    --- 5.54.0-1/autotests/propertyinfotest.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/propertyinfotest.h 2019-08-03 19:54:00.000000000 +0000 @@ -28,8 +28,16 @@ namespace KFileMetaData { class PropertyInfoTest : public QObject { Q_OBJECT +public: + void setLocalized(bool); + private Q_SLOTS: + void init(); void testNameIdMapping(); + void testFormatAsDisplayString(); + void testFormatAsDisplayString_data(); +private: + bool m_useLocalization = false; }; } Binary files 5.54.0-1/autotests/samplefiles/misdetected/test_arcgis_geodata.spx and 5.61.0-0ubuntu1/autotests/samplefiles/misdetected/test_arcgis_geodata.spx differ Binary files 5.54.0-1/autotests/samplefiles/test.ape and 5.61.0-0ubuntu1/autotests/samplefiles/test.ape differ Binary files 5.54.0-1/autotests/samplefiles/test.AppImage and 5.61.0-0ubuntu1/autotests/samplefiles/test.AppImage differ
  68. Download patch autotests/odfextractortest.h

    --- 5.54.0-1/autotests/odfextractortest.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/odfextractortest.h 2019-08-03 19:54:00.000000000 +0000 @@ -23,6 +23,7 @@ #define ODFEXTRACTORTEST_H #include <QObject> +#include <QMimeDatabase> class OdfExtractorTest : public QObject { @@ -38,6 +39,9 @@ private Q_SLOTS: void testTextMissingMetaNoCrash(); void testTextMissingContentNoCrash(); + +private: + QMimeDatabase mimeDb; }; #endif // ODFEXTRACTORTEST_H
  69. Download patch po/en_GB/kfilemetadata5.po
  70. Download patch autotests/exiv2extractortest.h

    --- 5.54.0-1/autotests/exiv2extractortest.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/exiv2extractortest.h 2019-08-03 19:54:00.000000000 +0000 @@ -31,6 +31,7 @@ private: private Q_SLOTS: void test(); + void testGPS(); }; #endif // EXIV2EXTRACTORTEST_H
  71. Download patch po/bg/kfilemetadata5.po
  72. Download patch autotests/postscriptdscextractortest.h

    --- 5.54.0-1/autotests/postscriptdscextractortest.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/postscriptdscextractortest.h 2019-08-03 19:54:00.000000000 +0000 @@ -21,6 +21,7 @@ #define POSTSCRIPTDSCEXTRACTORTEST_H #include <QObject> +#include <QMimeDatabase> class PostscriptDscExtractorTest : public QObject { @@ -31,6 +32,8 @@ private: private Q_SLOTS: void testPS(); void testEPS(); +private: + QMimeDatabase mimeDb; }; #endif // POSTSCRIPTDSCEXTRACTORTEST_H
  73. Download patch src/embeddedimagedata.h

    --- 5.54.0-1/src/embeddedimagedata.h 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/src/embeddedimagedata.h 2019-08-03 19:54:00.000000000 +0000 @@ -23,7 +23,6 @@ #include "kfilemetadata_export.h" #include <QByteArray> -#include <QFlags> #include <QMap> #include <memory>
  74. Download patch po/pt_BR/kfilemetadata5.po
  75. Download patch src/embeddedimagedata.cpp

    --- 5.54.0-1/src/embeddedimagedata.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/src/embeddedimagedata.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -18,6 +18,7 @@ */ #include "embeddedimagedata.h" +#include "kfilemetadata_debug.h" // Taglib includes #include <taglib.h> #include <tag.h> @@ -28,7 +29,6 @@ #include <flacfile.h> #include <vorbisfile.h> #include <opusfile.h> -#include <apetag.h> #include <mpcfile.h> #include <id3v2tag.h> #include <attachedpictureframe.h> @@ -45,7 +45,6 @@ #include <asfpicture.h> #include <QMimeDatabase> -#include <QDebug> using namespace KFileMetaData; @@ -119,7 +118,7 @@ EmbeddedImageData::Private::getFrontCove { TagLib::FileStream stream(fileUrl.toUtf8().constData(), true); if (!stream.isOpen()) { - qWarning() << "Unable to open file readonly: " << fileUrl; + qCWarning(KFILEMETADATA_LOG) << "Unable to open file readonly: " << fileUrl; return QByteArray(); } if ((mimeType == QLatin1String("audio/mpeg"))
  76. Download patch po/pl/kfilemetadata5.po
  77. Download patch autotests/samplefiles/test.mml

    --- 5.54.0-1/autotests/samplefiles/test.mml 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/samplefiles/test.mml 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<math xmlns="http://www.w3.org/1998/Math/MathML"> + <mrow> + <mn>1</mn> + <mo>+</mo> + <mn>1</mn> + <mo>=</mo> + <mn>2</mn> + </mrow> +</math> + Binary files 5.54.0-1/autotests/samplefiles/test.mobi and 5.61.0-0ubuntu1/autotests/samplefiles/test.mobi differ Binary files 5.54.0-1/autotests/samplefiles/test.mpc and 5.61.0-0ubuntu1/autotests/samplefiles/test.mpc differ Binary files 5.54.0-1/autotests/samplefiles/test_multivalue.ogg and 5.61.0-0ubuntu1/autotests/samplefiles/test_multivalue.ogg differ Binary files 5.54.0-1/autotests/samplefiles/test_no_gps.jpg and 5.61.0-0ubuntu1/autotests/samplefiles/test_no_gps.jpg differ Binary files 5.54.0-1/autotests/samplefiles/test.ogg and 5.61.0-0ubuntu1/autotests/samplefiles/test.ogg differ Binary files 5.54.0-1/autotests/samplefiles/test.ogv and 5.61.0-0ubuntu1/autotests/samplefiles/test.ogv differ Binary files 5.54.0-1/autotests/samplefiles/test.opus and 5.61.0-0ubuntu1/autotests/samplefiles/test.opus differ
  78. Download patch po/tr/kfilemetadata5.po
  79. Download patch po/da/kfilemetadata5.po
  80. Download patch po/sl/kfilemetadata5.po
  81. Download patch po/cs/kfilemetadata5.po
  82. Download patch src/extractorcollection.cpp
  83. Download patch debian/source/lintian-overrides

    --- 5.54.0-1/debian/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/source/lintian-overrides 2019-08-12 09:42:04.000000000 +0000 @@ -0,0 +1,2 @@ +# only used for autotests +kfilemetadata-kf5 source: source-is-missing autotests/samplefiles/test.AppImage
  84. Download patch debian/libkf5filemetadata-data.maintscript

    --- 5.54.0-1/debian/libkf5filemetadata-data.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/libkf5filemetadata-data.maintscript 2019-08-12 09:42:04.000000000 +0000 @@ -0,0 +1 @@ +rm_conffile /etc/xdg/kfilemetadata.categories
  85. Download patch po/fr/kfilemetadata5.po
  86. Download patch autotests/epubextractortest.cpp

    --- 5.54.0-1/autotests/epubextractortest.cpp 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/epubextractortest.cpp 2019-08-03 19:54:00.000000000 +0000 @@ -22,10 +22,10 @@ #include "simpleextractionresult.h" #include "indexerextractortestsconfig.h" #include "extractors/epubextractor.h" +#include "mimeutils.h" -#include <QDebug> #include <QTest> -#include <QDir> +#include <QMimeDatabase> using namespace KFileMetaData; @@ -38,7 +38,12 @@ void EPubExtractorTest::test() { EPubExtractor plugin{this}; - SimpleExtractionResult result(testFilePath("test.epub"), "application/epub+zip"); + QString fileName = testFilePath(QStringLiteral("test.epub")); + QMimeDatabase mimeDb; + QString mimeType = MimeUtils::strictMimeType(fileName, mimeDb).name(); + QVERIFY(plugin.mimetypes().contains(mimeType)); + + SimpleExtractionResult result(fileName, mimeType); plugin.extract(&result); QCOMPARE(result.types().size(), 1);
  87. Download patch po/el/kfilemetadata5.po
  88. Download patch po/sr/kfilemetadata5.po
  89. Download patch po/bs/kfilemetadata5.po
  90. Download patch src/CMakeLists.txt

    --- 5.54.0-1/src/CMakeLists.txt 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/src/CMakeLists.txt 2019-08-03 19:54:00.000000000 +0000 @@ -1,3 +1,5 @@ +ecm_qt_declare_logging_category(debug_SRCS HEADER kfilemetadata_debug.h IDENTIFIER KFILEMETADATA_LOG CATEGORY_NAME kf5.kfilemetadata) + set(KF5FileMetaData_SRCS extractionresult.cpp simpleextractionresult.cpp @@ -13,8 +15,11 @@ set(KF5FileMetaData_SRCS writerplugin.cpp writercollection.cpp externalwriter.cpp + formatstrings.cpp + mimeutils.cpp + ${debug_SRCS} ) -ecm_qt_declare_logging_category(KF5FileMetaData_SRCS HEADER kfilemetadata_debug.h IDENTIFIER KFILEMETADATA_LOG CATEGORY_NAME kf5.kfilemetadata) + if(TAGLIB_FOUND) set(KF5FileMetaData_SRCS @@ -34,6 +39,7 @@ target_link_libraries(KF5FileMetaData Qt5::Core PRIVATE KF5::I18n + KF5::CoreAddons ) if(TAGLIB_FOUND) @@ -72,6 +78,7 @@ ecm_generate_headers(KF5FileMetaData_Cam WriterPlugin WriterCollection EmbeddedImageData + MimeUtils PREFIX kfilemetadata REQUIRED_HEADERS KF5FileMetaData_HEADERS
  91. Download patch po/es/kfilemetadata5.po
  92. Download patch po/uk/kfilemetadata5.po
  93. Download patch debian/libkf5filemetadata-dev.acc.in

    --- 5.54.0-1/debian/libkf5filemetadata-dev.acc.in 2019-01-17 22:26:48.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/libkf5filemetadata-dev.acc.in 2019-08-12 09:42:04.000000000 +0000 @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version='1.0' encoding='utf-8'?> <descriptor> <version> @@ -15,6 +15,7 @@ <gcc_options> -fPIC + -fno-keep-inline-functions -std=c++11 </gcc_options>
  94. Download patch po/nl/kfilemetadata5.po
  95. Download patch autotests/samplefiles/test_public_key.gpg

    --- 5.54.0-1/autotests/samplefiles/test_public_key.gpg 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/samplefiles/test_public_key.gpg 2019-08-03 19:54:00.000000000 +0000 @@ -0,0 +1,13 @@ +-----BEGIN PGP MESSAGE----- + +hQEOAzGVJoG5Qh0NEAQAmhRrr11MKke1+4aYgiSJUYZ2B0Zrcp+EQhaOU7PRsb4e +46QvEb9UdpqZrzYjA51tzt2JwR+MJL9nlcfdxaM3Gvzcvrq/1z/YmrtCWgwDi/5e +A96e3v9A1Hmh+GqwzrIhntVuJDyQhJddiWB1uC2+h95oep4fVy/fIXeyVOHjLXkD +/1NQnxdcFfnptFsW6j8mDaXjfY5zkexqQlRrGCvfeFygrUBxfHHW+DJKJWmubZYD +l/NzqQ1cJ5xCltGgnlIrdyoOewAzXJ+Dj6eMcZCz+Hr+SAxHo0CGMBTxNo+W86/B +QTbZFMG9vf17tWq65JkRiLVGOgcEi0hT9vC93ljvwoBn0ncBM70fxNCesACry/TO +ZRV9YJ8lXaL2oznbSp4dRBRdT6Wj9gkAsN8NV/Hmr9rPDCan02ktObIptSLlO3pn +FqaPVsMfdWxeQCQqde8LVE2HFzWnK3gx3Jehth/spATlFyFORJIQJ9umkRkKDwB+ +lqZ9bFtpQOorfA== +=4vgj +-----END PGP MESSAGE----- Binary files 5.54.0-1/autotests/samplefiles/test.spx and 5.61.0-0ubuntu1/autotests/samplefiles/test.spx differ Binary files 5.54.0-1/autotests/samplefiles/test.ts and 5.61.0-0ubuntu1/autotests/samplefiles/test.ts differ Binary files 5.54.0-1/autotests/samplefiles/test.webm and 5.61.0-0ubuntu1/autotests/samplefiles/test.webm differ
  96. Download patch debian/patches/fix-propertyinfotest.patch

    --- 5.54.0-1/debian/patches/fix-propertyinfotest.patch 1970-01-01 00:00:00.000000000 +0000 +++ 5.61.0-0ubuntu1/debian/patches/fix-propertyinfotest.patch 2019-08-12 09:42:04.000000000 +0000 @@ -0,0 +1,15 @@ +Description: Fix incorrect logic in new test inputs +Author: Rik Mills <rikmills@kubuntu.org +Forwarded: Yes + +--- a/autotests/propertyinfotest.cpp ++++ b/autotests/propertyinfotest.cpp +@@ -113,7 +113,7 @@ + } rows[] = { + { Property::DiscNumber, true, 2018, QStringLiteral("2018")}, + { Property::Title, false, QStringLiteral("Title"), QStringLiteral("Title")}, +- { Property::Title, false, titleList, QStringLiteral("Title1 and Title2")}, ++ { Property::Title, true, titleList, QStringLiteral("Title1 and Title2")}, + { Property::Artist, true, artistList, QStringLiteral("Artist1, Artist2, and Artist3")}, + { Property::Author, true, authorList, QStringLiteral("Author1")}, + { Property::Arranger, true, arrangerList, QStringLiteral("Arranger1 and Arranger2")},
  97. Download patch autotests/taglibwritertest.cpp
  98. Download patch autotests/CMakeLists.txt

    --- 5.54.0-1/autotests/CMakeLists.txt 2019-01-06 20:21:52.000000000 +0000 +++ 5.61.0-0ubuntu1/autotests/CMakeLists.txt 2019-08-03 19:54:00.000000000 +0000 @@ -15,6 +15,21 @@ set(KfileMetaDataAutotest_SRCS) ecm_qt_declare_logging_category(KfileMetaDataAutotest_SRCS HEADER kfilemetadata_debug.h IDENTIFIER KFILEMETADATA_LOG CATEGORY_NAME kf5.kfilemetadata) +# +# Test case coverage +# +set(extractorcoverage_SRCS + extractorcoveragetest.cpp +) + +ecm_add_test(${extractorcoverage_SRCS} + TEST_NAME "extractorcoveragetest" + LINK_LIBRARIES Qt5::Test KF5::FileMetaData +) + +# +# Full text extraction test +# set(indexerextractor_SRCS indexerextractortests.cpp ../src/extractors/plaintextextractor.cpp @@ -67,22 +82,25 @@ endif() # # Mobi # -if (QMOBIPOCKET_FOUND) - include_directories(${QMOBIPOCKET_INCLUDE_DIR}) - +if (QMobipocket_FOUND) ecm_add_test(mobiextractortest.cpp ../src/extractors/mobiextractor.cpp TEST_NAME "mobiextractortest" - LINK_LIBRARIES Qt5::Test KF5::FileMetaData ${QMOBIPOCKET_LIBRARIES} + LINK_LIBRARIES Qt5::Test KF5::FileMetaData qmobipocket ) endif() # # Property Info # -ecm_add_test(propertyinfotest.cpp - TEST_NAME "propertyinfotest" - LINK_LIBRARIES Qt5::Test KF5::FileMetaData -) +add_executable(propertyinfotest_bin propertyinfotest.cpp) +target_link_libraries(propertyinfotest_bin + Qt5::Test + KF5::FileMetaData +) +ecm_mark_as_test(propertyinfotest_bin) +ecm_mark_nongui_executable(propertyinfotest_bin) +add_test(NAME propertyinfotest_en COMMAND propertyinfotest_bin) +add_test(NAME propertyinfotest_localized COMMAND propertyinfotest_bin "--localized") # # Exiv2 @@ -93,6 +111,19 @@ if(LibExiv2_FOUND) TEST_NAME "exiv2extractortest" LINK_LIBRARIES Qt5::Test KF5::FileMetaData LibExiv2::LibExiv2 ) + target_include_directories(exiv2extractortest PRIVATE ${CMAKE_BINARY_DIR}/src/extractors) +endif() + +# +# FFMPEG +# +if(FFMPEG_FOUND) + kde_enable_exceptions() + ecm_add_test(ffmpegextractortest.cpp ../src/extractors/ffmpegextractor.cpp + TEST_NAME "ffmpegextractortest" + LINK_LIBRARIES Qt5::Test KF5::FileMetaData ${AVCODEC_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVUTIL_LIBRARIES} + ) + target_include_directories(ffmpegextractortest SYSTEM PRIVATE ${AVCODEC_INCLUDE_DIRS} ${AVFORMAT_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS}) endif() # @@ -100,7 +131,7 @@ endif() # if(TAGLIB_FOUND) kde_enable_exceptions() - ecm_add_test(taglibextractortest.cpp ../src/extractors/taglibextractor.cpp + ecm_add_test(taglibextractortest.cpp ../src/extractors/taglibextractor.cpp ${KfileMetaDataAutotest_SRCS} TEST_NAME "taglibextractortest" LINK_LIBRARIES Qt5::Test KF5::FileMetaData ${TAGLIB_LIBRARIES} ) @@ -164,6 +195,22 @@ ecm_add_test(${postscriptdscextractor_SR LINK_LIBRARIES Qt5::Test KF5::FileMetaData ) +# +# AppImage +# +if(libappimage_FOUND AND KF5Config_FOUND AND Qt5Gui_FOUND) + ecm_add_test(appimageextractortest.cpp ../src/extractors/appimageextractor.cpp + TEST_NAME "appimageextractortest" + LINK_LIBRARIES + Qt5::Test + KF5::FileMetaData + KF5::ConfigCore + Qt5::Xml + Qt5::Gui + libappimage + ) +endif() + ################ # Writer tests # ################ @@ -171,7 +218,7 @@ ecm_add_test(${postscriptdscextractor_SR # # UserMetaData # -if(CMAKE_SYSTEM_NAME MATCHES "Linux") +if(UNIX) kde_enable_exceptions() ecm_add_test(usermetadatawritertest.cpp ../src/usermetadata.cpp TEST_NAME "usermetadatawritertest" @@ -184,7 +231,7 @@ endif() # if(TAGLIB_FOUND) kde_enable_exceptions() - ecm_add_test(taglibwritertest.cpp ../src/writers/taglibwriter.cpp + ecm_add_test(taglibwritertest.cpp ../src/writers/taglibwriter.cpp ${KfileMetaDataAutotest_SRCS} TEST_NAME "taglibwritertest" LINK_LIBRARIES Qt5::Test KF5::FileMetaData ${TAGLIB_LIBRARIES} )
  99. Download patch po/gl/kfilemetadata5.po
  100. Download patch po/ar/kfilemetadata5.po
  101. ...
  1. kfilemetadata-kf5