Hello community, here is the log from the commit of package kfilemetadata5 for openSUSE:Factory checked in at 2018-01-09 14:41:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kfilemetadata5 (Old) and /work/SRC/openSUSE:Factory/.kfilemetadata5.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kfilemetadata5" Tue Jan 9 14:41:54 2018 rev:53 rq:559439 version:5.41.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kfilemetadata5/kfilemetadata5.changes 2017-11-16 14:37:51.665531033 +0100 +++ /work/SRC/openSUSE:Factory/.kfilemetadata5.new/kfilemetadata5.changes 2018-01-09 14:41:55.847487111 +0100 @@ -1,0 +2,16 @@ +Sun Dec 17 09:43:48 CET 2017 - [email protected] + +- Update to 5.41.0 + * New feature release + * For more details please see: + * https://www.kde.org/announcements/kde-frameworks-5.41.0.php +- Changes since 5.40.0: + * The usermetadatawritertest requires Taglib. Therefore if Taglib isn't around, we shouldn't try to build something that requires it. This fixes the build on Windows. + * Port to debug category + * Fix UserMetaData unit tests. + * User meta data (xattr key-value) unit tests. + * Simplify empty rating check. + * If the property value is null, remove the user.xdg.tag attribute. (kde#376117) + * Open files in TagLib extractor readonly + +------------------------------------------------------------------- Old: ---- kfilemetadata-5.40.0.tar.xz New: ---- kfilemetadata-5.41.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kfilemetadata5.spec ++++++ --- /var/tmp/diff_new_pack.LvU1fM/_old 2018-01-09 14:41:56.551454097 +0100 +++ /var/tmp/diff_new_pack.LvU1fM/_new 2018-01-09 14:41:56.551454097 +0100 @@ -18,13 +18,13 @@ %bcond_without ffmpeg %bcond_without lang -%define _tar_path 5.40 +%define _tar_path 5.41 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %global _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} Name: kfilemetadata5 -Version: 5.40.0 +Version: 5.41.0 Release: 0 %define kf5_version %{version} Summary: Extract Metadata @@ -94,6 +94,7 @@ %doc COPYING* %{_kf5_plugindir}/ %{_kf5_libdir}/libKF5FileMetaData.so.* +%{_kf5_debugdir}/*.categories %files devel %defattr(-,root,root) ++++++ kfilemetadata-5.40.0.tar.xz -> kfilemetadata-5.41.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/CMakeLists.txt new/kfilemetadata-5.41.0/CMakeLists.txt --- old/kfilemetadata-5.40.0/CMakeLists.txt 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/CMakeLists.txt 2017-12-02 21:04:38.000000000 +0100 @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.0) -set(KF5_VERSION "5.40.0") # handled by release scripts -set(KF5_DEP_VERSION "5.40.0") # handled by release scripts +set(KF5_VERSION "5.41.0") # handled by release scripts +set(KF5_DEP_VERSION "5.41.0") # handled by release scripts project(KFileMetaData VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.40.0 NO_MODULE) +find_package(ECM 5.41.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) @@ -19,6 +19,7 @@ include(ECMSetupVersion) include(ECMGenerateHeaders) include(ECMAddQch) +include(ECMQtDeclareLoggingCategory) option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") @@ -127,4 +128,6 @@ COMPONENT devel ) +# contains list of debug categories, for kdebugsettings +install(FILES kfilemetadata.categories DESTINATION ${KDE_INSTALL_CONFDIR}) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/autotests/CMakeLists.txt new/kfilemetadata-5.41.0/autotests/CMakeLists.txt --- old/kfilemetadata-5.40.0/autotests/CMakeLists.txt 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/autotests/CMakeLists.txt 2017-12-02 21:04:38.000000000 +0100 @@ -10,6 +10,11 @@ configure_file(indexerextractortestsconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/indexerextractortestsconfig.h @ONLY) + +set(KfileMetaDataAutotest_SRCS) +ecm_qt_declare_logging_category(KfileMetaDataAutotest_SRCS HEADER kfilemetadata_debug.h IDENTIFIER KFILEMETADATA_LOG CATEGORY_NAME kf5.kfilemetadata) + + set(indexerextractor_SRCS indexerextractortests.cpp ../src/extractors/plaintextextractor.cpp @@ -121,7 +126,7 @@ configure_file(samplefiles/testexternalextractor/main.py samplefiles/testexternalextractor/main.py) configure_file(samplefiles/testexternalextractor/manifest.json samplefiles/testexternalextractor/manifest.json COPYONLY) - ecm_add_test(externalextractortest.cpp ../src/externalextractor.cpp + ecm_add_test(externalextractortest.cpp ../src/externalextractor.cpp ${KfileMetaDataAutotest_SRCS} TEST_NAME "externalextractortest" LINK_LIBRARIES Qt5::Test KF5::FileMetaData KF5::I18n ) @@ -144,6 +149,20 @@ ################ # +# UserMetaData +# + +if(TAGLIB_FOUND) + include_directories(${TAGLIB_INCLUDES}) + + kde_enable_exceptions() + ecm_add_test(usermetadatawritertest.cpp ../src/usermetadata.cpp + TEST_NAME "usermetadatawritertest" + LINK_LIBRARIES Qt5::Test KF5::FileMetaData + ) +endif() + +# # TagLib # if(TAGLIB_FOUND) @@ -160,7 +179,7 @@ configure_file(samplefiles/testexternalwriter/main.py samplefiles/testexternalwriter/main.py) configure_file(samplefiles/testexternalwriter/manifest.json samplefiles/testexternalwriter/manifest.json COPYONLY) - ecm_add_test(externalwritertest.cpp ../src/externalwriter.cpp + ecm_add_test(externalwritertest.cpp ../src/externalwriter.cpp ${KfileMetaDataAutotest_SRCS} TEST_NAME "externalwritertest" LINK_LIBRARIES Qt5::Test KF5::FileMetaData KF5::I18n ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/autotests/usermetadatawritertest.cpp new/kfilemetadata-5.41.0/autotests/usermetadatawritertest.cpp --- old/kfilemetadata-5.40.0/autotests/usermetadatawritertest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/kfilemetadata-5.41.0/autotests/usermetadatawritertest.cpp 2017-12-02 21:04:38.000000000 +0100 @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2017 James D. Smith <[email protected]> + * + * 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 "usermetadatawritertest.h" +#include "indexerextractortestsconfig.h" +#include "usermetadata.h" + +#include "fileref.h" + +#include <QDebug> +#include <QTest> +#include <QDir> +#include <QFile> + +#define TEST_FILENAME "writertest.txt" + +using namespace KFileMetaData; + +QString UserMetaDataWriterTest::testFilePath(const QString& fileName) const +{ + return QLatin1String(INDEXER_TESTS_SAMPLE_FILES_PATH) + QDir::separator() + fileName; +} + +void UserMetaDataWriterTest::initTestCase() +{ + QFile testFile(testFilePath("plain_text_file.txt")); + QFile writerTestFile(testFilePath(TEST_FILENAME)); + QFile::copy(testFilePath("plain_text_file.txt"), testFilePath(TEST_FILENAME)); +} + +void UserMetaDataWriterTest::test() +{ + + KFileMetaData::UserMetaData md(testFilePath(TEST_FILENAME)); + QVERIFY(md.isSupported()); + + // Tags + md.setTags(QStringList() << QStringLiteral("this/is/a/test/tag")); + QCOMPARE(md.tags().at(0), QStringLiteral("this/is/a/test/tag")); + md.setTags(QStringList()); + QVERIFY(!md.hasAttribute(QStringLiteral("xdg.tags"))); + + // Rating + md.setRating(3); + QCOMPARE(md.rating(), 3); + md.setRating(0); + QVERIFY(!md.hasAttribute(QStringLiteral("baloo.rating"))); + + // Comment + md.setUserComment(QStringLiteral("this is a test comment")); + QCOMPARE(md.userComment(), QStringLiteral("this is a test comment")); + md.setUserComment(QString()); + QVERIFY(!md.hasAttribute(QStringLiteral("xdg.comment"))); + + // Origin url + md.setOriginUrl(QUrl("http://this.is.a.test.website.local")); + QCOMPARE(md.originUrl(), QUrl("http://this.is.a.test.website.local")); + md.setOriginUrl(QUrl()); + QVERIFY(!md.hasAttribute(QStringLiteral("xdg.origin.url"))); + + // Origin e-mail subject + md.setOriginEmailSubject(QStringLiteral("this is a test e-mail subject")); + QCOMPARE(md.originEmailSubject(), QStringLiteral("this is a test e-mail subject")); + md.setOriginEmailSubject(QString()); + QVERIFY(!md.hasAttribute(QStringLiteral("xdg.origin.email.subject"))); + + // Origin e-mail sender + md.setOriginEmailSender(QStringLiteral("Blue Bear")); + QCOMPARE(md.originEmailSender(), QStringLiteral("Blue Bear")); + md.setOriginEmailSender(QString()); + QVERIFY(!md.hasAttribute(QStringLiteral("xdg.origin.email.sender"))); + + // Origin e-mail message id + md.setOriginEmailMessageId(QStringLiteral("19991231235959.52234.24C26516HHBTF1C4")); + QCOMPARE(md.originEmailMessageId(), QStringLiteral("19991231235959.52234.24C26516HHBTF1C4")); + md.setOriginEmailMessageId(QString()); + QVERIFY(!md.hasAttribute(QStringLiteral("xdg.origin.email.message-id"))); + + // Attribute + md.setAttribute(QStringLiteral("test.attribute"), QStringLiteral("attribute")); + QCOMPARE(md.attribute(QStringLiteral("test.attribute")), QStringLiteral("attribute")); + md.setAttribute(QStringLiteral("test.attribute"), QString()); + QVERIFY(!md.hasAttribute(QStringLiteral("test.attribute"))); +} + +void UserMetaDataWriterTest::cleanupTestCase() +{ + QFile::remove(testFilePath(TEST_FILENAME)); +} + +QTEST_GUILESS_MAIN(UserMetaDataWriterTest) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/autotests/usermetadatawritertest.h new/kfilemetadata-5.41.0/autotests/usermetadatawritertest.h --- old/kfilemetadata-5.40.0/autotests/usermetadatawritertest.h 1970-01-01 01:00:00.000000000 +0100 +++ new/kfilemetadata-5.41.0/autotests/usermetadatawritertest.h 2017-12-02 21:04:38.000000000 +0100 @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2017 James D. Smith <[email protected]> + * + * 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 USERMETADATAWRITERTEST_H +#define USERMETADATAWRITERTEST_H + +#include <QObject> + +class UserMetaDataWriterTest : public QObject +{ + Q_OBJECT +private: + QString testFilePath(const QString& fileName) const; + +private Q_SLOTS: + void initTestCase(); + void test(); + void cleanupTestCase(); +}; + +#endif // USERMETADATAWRITERTEST_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/kfilemetadata.categories new/kfilemetadata-5.41.0/kfilemetadata.categories --- old/kfilemetadata-5.40.0/kfilemetadata.categories 1970-01-01 01:00:00.000000000 +0100 +++ new/kfilemetadata-5.41.0/kfilemetadata.categories 2017-12-02 21:04:38.000000000 +0100 @@ -0,0 +1 @@ +kf5.kfilemetadata KFileMetaData diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/po/cs/kfilemetadata5.po new/kfilemetadata-5.41.0/po/cs/kfilemetadata5.po --- old/kfilemetadata-5.40.0/po/cs/kfilemetadata5.po 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/po/cs/kfilemetadata5.po 2017-12-02 21:04:38.000000000 +0100 @@ -7,8 +7,8 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2017-10-17 03:36+0200\n" -"PO-Revision-Date: 2017-02-21 14:16+0100\n" -"Last-Translator: Vít Pelčák <[email protected]>\n" +"PO-Revision-Date: 2017-11-14 14:14+0100\n" +"Last-Translator: Vit Pelcak <[email protected]>\n" "Language-Team: Czech <[email protected]>\n" "Language: cs\n" "MIME-Version: 1.0\n" @@ -101,7 +101,7 @@ #, kde-format msgctxt "@label" msgid "Document Generated By" -msgstr "" +msgstr "Dokynment byl nevygenerován pomocí" #: src/propertyinfo.cpp:141 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/po/de/kfilemetadata5.po new/kfilemetadata-5.41.0/po/de/kfilemetadata5.po --- old/kfilemetadata-5.40.0/po/de/kfilemetadata5.po 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/po/de/kfilemetadata5.po 2017-12-02 21:04:38.000000000 +0100 @@ -5,7 +5,7 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2017-10-17 03:36+0200\n" -"PO-Revision-Date: 2017-04-18 15:00+0100\n" +"PO-Revision-Date: 2017-11-27 09:47+0100\n" "Last-Translator: Burkhard Lück <[email protected]>\n" "Language-Team: German <[email protected]>\n" "Language: de\n" @@ -97,7 +97,7 @@ #, kde-format msgctxt "@label" msgid "Document Generated By" -msgstr "" +msgstr "Dokument erstellt von" #: src/propertyinfo.cpp:141 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/po/en_GB/kfilemetadata5.po new/kfilemetadata-5.41.0/po/en_GB/kfilemetadata5.po --- old/kfilemetadata-5.40.0/po/en_GB/kfilemetadata5.po 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/po/en_GB/kfilemetadata5.po 2017-12-02 21:04:38.000000000 +0100 @@ -7,9 +7,9 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2017-10-17 03:36+0200\n" -"PO-Revision-Date: 2017-02-10 16:39+0000\n" +"PO-Revision-Date: 2017-11-26 15:54+0000\n" "Last-Translator: Steve Allewell <[email protected]>\n" -"Language-Team: English <[email protected]>\n" +"Language-Team: British English <[email protected]>\n" "Language: en_GB\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -99,7 +99,7 @@ #, kde-format msgctxt "@label" msgid "Document Generated By" -msgstr "" +msgstr "Document Generated By" #: src/propertyinfo.cpp:141 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/po/fr/kfilemetadata5.po new/kfilemetadata-5.41.0/po/fr/kfilemetadata5.po --- old/kfilemetadata-5.40.0/po/fr/kfilemetadata5.po 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/po/fr/kfilemetadata5.po 2017-12-02 21:04:38.000000000 +0100 @@ -1,6 +1,6 @@ # Copyright (C) YEAR This_file_is_part_of_KDE # This file is distributed under the same license as the PACKAGE package. -# Vincent PINON <[email protected]>, 2014, 2016. +# Vincent PINON <[email protected]>, 2014, 2016, 2017. # Sebastien Renard <[email protected]>, 2014, 2015. # Simon Depiets <[email protected]>, 2017. # @@ -9,8 +9,8 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2017-10-17 03:36+0200\n" -"PO-Revision-Date: 2017-05-15 10:28+0800\n" -"Last-Translator: Simon Depiets <[email protected]>\n" +"PO-Revision-Date: 2017-11-06 07:27+0100\n" +"Last-Translator: Vincent Pinon <[email protected]>\n" "Language-Team: French <[email protected]>\n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -104,7 +104,7 @@ #, kde-format msgctxt "@label" msgid "Document Generated By" -msgstr "" +msgstr "Document généré par" #: src/propertyinfo.cpp:141 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/po/pl/kfilemetadata5.po new/kfilemetadata-5.41.0/po/pl/kfilemetadata5.po --- old/kfilemetadata-5.40.0/po/pl/kfilemetadata5.po 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/po/pl/kfilemetadata5.po 2017-12-02 21:04:38.000000000 +0100 @@ -7,7 +7,7 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2017-10-17 03:36+0200\n" -"PO-Revision-Date: 2017-02-18 07:17+0100\n" +"PO-Revision-Date: 2017-12-02 07:33+0100\n" "Last-Translator: Łukasz Wojniłowicz <[email protected]>\n" "Language-Team: Polish <[email protected]>\n" "Language: pl\n" @@ -100,7 +100,7 @@ #, kde-format msgctxt "@label" msgid "Document Generated By" -msgstr "" +msgstr "Dokument utworzony przez" #: src/propertyinfo.cpp:141 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/po/tr/kfilemetadata5.po new/kfilemetadata-5.41.0/po/tr/kfilemetadata5.po --- old/kfilemetadata-5.40.0/po/tr/kfilemetadata5.po 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/po/tr/kfilemetadata5.po 2017-12-02 21:04:38.000000000 +0100 @@ -7,7 +7,7 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2017-10-17 03:36+0200\n" -"PO-Revision-Date: 2017-05-08 15:00+0000\n" +"PO-Revision-Date: 2017-10-23 09:49+0000\n" "Last-Translator: Kaan <[email protected]>\n" "Language-Team: Turkish <[email protected]>\n" "Language: tr\n" @@ -99,7 +99,7 @@ #, kde-format msgctxt "@label" msgid "Document Generated By" -msgstr "" +msgstr "Belgeyi Oluşturan" #: src/propertyinfo.cpp:141 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/po/zh_CN/kfilemetadata5.po new/kfilemetadata-5.41.0/po/zh_CN/kfilemetadata5.po --- old/kfilemetadata-5.40.0/po/zh_CN/kfilemetadata5.po 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/po/zh_CN/kfilemetadata5.po 2017-12-02 21:04:38.000000000 +0100 @@ -10,7 +10,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2017-10-17 03:36+0200\n" -"PO-Revision-Date: 2017-10-19 10:41-0400\n" +"PO-Revision-Date: 2017-11-09 08:33-0500\n" "Last-Translator: guoyunhebrave <[email protected]>\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" @@ -105,7 +105,7 @@ #, kde-format msgctxt "@label" msgid "Document Generated By" -msgstr "" +msgstr "文档生成自" #: src/propertyinfo.cpp:141 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/po/zh_TW/kfilemetadata5.po new/kfilemetadata-5.41.0/po/zh_TW/kfilemetadata5.po --- old/kfilemetadata-5.40.0/po/zh_TW/kfilemetadata5.po 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/po/zh_TW/kfilemetadata5.po 2017-12-02 21:04:38.000000000 +0100 @@ -1,16 +1,16 @@ # Copyright (C) YEAR This_file_is_part_of_KDE # This file is distributed under the same license as the PACKAGE package. # -# Franklin Weng <franklin at goodhorse dot idv dot tw>, 2014, 2015. +# Franklin Weng <franklin at goodhorse dot idv dot tw>, 2014, 2015, 2017. # Jeff Huang <[email protected]>, 2016, 2017. msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2017-10-17 03:36+0200\n" -"PO-Revision-Date: 2017-02-06 21:32+0800\n" -"Last-Translator: Jeff Huang <[email protected]>\n" -"Language-Team: Chinese <[email protected]>\n" +"PO-Revision-Date: 2017-11-11 20:17+0800\n" +"Last-Translator: Franklin Weng <[email protected]>\n" +"Language-Team: Chinese <[email protected]>\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -100,7 +100,7 @@ #, kde-format msgctxt "@label" msgid "Document Generated By" -msgstr "" +msgstr "文件產生於" #: src/propertyinfo.cpp:141 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/src/CMakeLists.txt new/kfilemetadata-5.41.0/src/CMakeLists.txt --- old/kfilemetadata-5.40.0/src/CMakeLists.txt 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/src/CMakeLists.txt 2017-12-02 21:04:38.000000000 +0100 @@ -1,4 +1,4 @@ -add_library(KF5FileMetaData +set(KF5FileMetaData_SRCS extractionresult.cpp simpleextractionresult.cpp extractor.cpp @@ -13,6 +13,11 @@ writerplugin.cpp writercollection.cpp externalwriter.cpp + ) +ecm_qt_declare_logging_category(KF5FileMetaData_SRCS HEADER kfilemetadata_debug.h IDENTIFIER KFILEMETADATA_LOG CATEGORY_NAME kf5.kfilemetadata) + +add_library(KF5FileMetaData + ${KF5FileMetaData_SRCS} ) add_library(KF5::FileMetaData ALIAS KF5FileMetaData) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/src/externalextractor.cpp new/kfilemetadata-5.41.0/src/externalextractor.cpp --- old/kfilemetadata-5.40.0/src/externalextractor.cpp 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/src/externalextractor.cpp 2017-12-02 21:04:38.000000000 +0100 @@ -22,8 +22,8 @@ */ #include "externalextractor.h" +#include "kfilemetadata_debug.h" -#include <QDebug> #include <QDir> #include <QProcess> #include <QJsonDocument> @@ -65,7 +65,7 @@ QStringList pluginDirContents = pluginDir.entryList(); if (!pluginDirContents.contains(QStringLiteral("manifest.json"))) { - qDebug() << "Path does not seem to contain a valid plugin"; + qCDebug(KFILEMETADATA_LOG) << "Path does not seem to contain a valid plugin"; return; } @@ -73,7 +73,7 @@ manifest.open(QIODevice::ReadOnly); QJsonDocument manifestDoc = QJsonDocument::fromJson(manifest.readAll()); if (!manifestDoc.isObject()) { - qDebug() << "Manifest does not seem to be a valid JSON Object"; + qCDebug(KFILEMETADATA_LOG) << "Manifest does not seem to be a valid JSON Object"; return; } @@ -123,7 +123,7 @@ errorOutput = extractorProcess.readAllStandardError(); if (extractorProcess.exitStatus()) { - qDebug() << errorOutput; + qCDebug(KFILEMETADATA_LOG) << errorOutput; return; } @@ -158,6 +158,6 @@ } if (rootObject[QStringLiteral("status")].toString() != QStringLiteral("OK")) { - qDebug() << rootObject[QStringLiteral("error")].toString(); + qCDebug(KFILEMETADATA_LOG) << rootObject[QStringLiteral("error")].toString(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/src/externalwriter.cpp new/kfilemetadata-5.41.0/src/externalwriter.cpp --- old/kfilemetadata-5.40.0/src/externalwriter.cpp 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/src/externalwriter.cpp 2017-12-02 21:04:38.000000000 +0100 @@ -19,8 +19,8 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ +#include "kfilemetadata_debug.h" -#include <QDebug> #include <QDir> #include <QProcess> #include <QJsonDocument> @@ -68,7 +68,7 @@ QStringList pluginDirContents = pluginDir.entryList(); if (!pluginDirContents.contains(QStringLiteral("manifest.json"))) { - qDebug() << "Path does not seem to contain a valid plugin"; + qCDebug(KFILEMETADATA_LOG) << "Path does not seem to contain a valid plugin"; return; } @@ -76,7 +76,7 @@ manifest.open(QIODevice::ReadOnly); QJsonDocument manifestDoc = QJsonDocument::fromJson(manifest.readAll()); if (!manifestDoc.isObject()) { - qDebug() << "Manifest does not seem to be a valid JSON Object"; + qCDebug(KFILEMETADATA_LOG) << "Manifest does not seem to be a valid JSON Object"; return; } @@ -128,8 +128,8 @@ errorOutput = writerProcess.readAllStandardError(); if (writerProcess.exitStatus()) { - qDebug() << "Something went wrong while trying to write data"; - qDebug() << errorOutput; + qCDebug(KFILEMETADATA_LOG) << "Something went wrong while trying to write data"; + qCDebug(KFILEMETADATA_LOG) << errorOutput; return; } @@ -142,8 +142,8 @@ QJsonObject outputRootObject = writerExitData.object(); if (outputRootObject[QStringLiteral("status")].toString() != QStringLiteral("OK")) { - qDebug() << outputRootObject[QStringLiteral("error")].toString(); - qDebug() << errorOutput; + qCDebug(KFILEMETADATA_LOG) << outputRootObject[QStringLiteral("error")].toString(); + qCDebug(KFILEMETADATA_LOG) << errorOutput; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/src/extractorcollection.cpp new/kfilemetadata-5.41.0/src/extractorcollection.cpp --- old/kfilemetadata-5.40.0/src/extractorcollection.cpp 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/src/extractorcollection.cpp 2017-12-02 21:04:38.000000000 +0100 @@ -23,8 +23,8 @@ #include "extractorplugin.h" #include "extractorcollection.h" #include "externalextractor.h" +#include "kfilemetadata_debug.h" -#include <QDebug> #include <QMimeDatabase> #include <QCoreApplication> #include <QPluginLoader> @@ -124,12 +124,12 @@ extractors << ex; } else { - qDebug() << "Plugin could not be converted to an ExtractorPlugin"; - qDebug() << pluginPath; + qCDebug(KFILEMETADATA_LOG) << "Plugin could not be converted to an ExtractorPlugin"; + qCDebug(KFILEMETADATA_LOG) << pluginPath; } } else { - qDebug() << "Plugin could not create instance" << pluginPath; + qCDebug(KFILEMETADATA_LOG) << "Plugin could not create instance" << pluginPath; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/src/extractors/taglibextractor.cpp new/kfilemetadata-5.41.0/src/extractors/taglibextractor.cpp --- old/kfilemetadata-5.40.0/src/extractors/taglibextractor.cpp 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/src/extractors/taglibextractor.cpp 2017-12-02 21:04:38.000000000 +0100 @@ -22,6 +22,7 @@ // Taglib includes #include <fileref.h> +#include <tfilestream.h> #include <flacfile.h> #include <apetag.h> #include <mpcfile.h> @@ -38,6 +39,7 @@ #include <xiphcomment.h> #include <QDateTime> +#include <QDebug> using namespace KFileMetaData; @@ -94,8 +96,16 @@ const QString fileUrl = result->inputUrl(); const QString mimeType = result->inputMimetype(); - TagLib::FileRef file(fileUrl.toUtf8().constData(), true); + // Open the file readonly. Important if we're sandboxed. + TagLib::FileStream stream(fileUrl.toUtf8().constData(), true); + if (!stream.isOpen()) { + qWarning() << "Unable to open file readonly: " << fileUrl; + return; + } + + TagLib::FileRef file(&stream, true); if (file.isNull()) { + qWarning() << "Unable to open file: " << fileUrl; return; } @@ -111,7 +121,7 @@ // Handling multiple tags in mpeg files. if ((mimeType == QLatin1String("audio/mpeg")) || (mimeType == QLatin1String("audio/mpeg3")) || (mimeType == QLatin1String("audio/x-mpeg"))) { - TagLib::MPEG::File mpegFile(fileUrl.toUtf8().constData(), true); + TagLib::MPEG::File mpegFile(&stream, TagLib::ID3v2::FrameFactory::instance(), true); if (mpegFile.ID3v2Tag() && !mpegFile.ID3v2Tag()->isEmpty()) { TagLib::ID3v2::FrameList lstID3v2; @@ -179,7 +189,7 @@ } if (mimeType == QStringLiteral("audio/mp4")) { - TagLib::MP4::File mp4File(fileUrl.toUtf8().constData(), true); + TagLib::MP4::File mp4File(&stream, true); if (mp4File.tag() && !mp4File.tag()->isEmpty()) { TagLib::MP4::ItemListMap allTags = mp4File.tag()->itemListMap(); @@ -208,7 +218,7 @@ // FLAC files. if (mimeType == QLatin1String("audio/flac")) { - TagLib::FLAC::File flacFile(fileUrl.toUtf8().constData(), true); + TagLib::FLAC::File flacFile(&stream, TagLib::ID3v2::FrameFactory::instance(), true); if (flacFile.xiphComment() && !flacFile.xiphComment()->isEmpty()) { lstOgg = flacFile.xiphComment()->fieldListMap(); } @@ -216,7 +226,7 @@ // Vorbis files. if (mimeType == QLatin1String("audio/ogg") || mimeType == QLatin1String("audio/x-vorbis+ogg")) { - TagLib::Ogg::Vorbis::File oggFile(fileUrl.toUtf8().constData(), true); + TagLib::Ogg::Vorbis::File oggFile(&stream, true); if (oggFile.tag() && !oggFile.tag()->isEmpty()) { lstOgg = oggFile.tag()->fieldListMap(); } @@ -224,7 +234,7 @@ // Opus files. if (mimeType == QLatin1String("audio/opus") || mimeType == QLatin1String("audio/x-opus+ogg")) { - TagLib::Ogg::Opus::File opusFile(fileUrl.toUtf8().constData(), true); + TagLib::Ogg::Opus::File opusFile(&stream, true); if (opusFile.tag() && !opusFile.tag()->isEmpty()) { lstOgg = opusFile.tag()->fieldListMap(); } @@ -286,7 +296,7 @@ // Handling multiple tags in Musepack files. if (mimeType == QLatin1String("audio/x-musepack")) { - TagLib::MPC::File mpcFile(fileUrl.toUtf8().constData(), true); + TagLib::MPC::File mpcFile(&stream, true); if (mpcFile.tag() && !mpcFile.tag()->isEmpty()) { TagLib::APE::ItemListMap lstMusepack = mpcFile.APETag()->itemListMap(); TagLib::APE::ItemListMap::ConstIterator itMPC; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/src/usermetadata.cpp new/kfilemetadata-5.41.0/src/usermetadata.cpp --- old/kfilemetadata-5.40.0/src/usermetadata.cpp 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/src/usermetadata.cpp 2017-12-02 21:04:38.000000000 +0100 @@ -59,7 +59,12 @@ UserMetaData::Error UserMetaData::setTags(const QStringList& tags) { - k_setxattr(d->filePath, QStringLiteral("user.xdg.tags"), tags.join(QLatin1Char(','))); + if (!tags.isEmpty()) { + k_setxattr(d->filePath, QStringLiteral("user.xdg.tags"), tags.join(QLatin1Char(','))); + } else { + k_removexattr(d->filePath, QStringLiteral("user.xdg.tags")); + } + return NoError; } @@ -81,7 +86,12 @@ UserMetaData::Error UserMetaData::setRating(int rating) { - k_setxattr(d->filePath, QStringLiteral("user.baloo.rating"), QString::number(rating)); + if (rating) { + k_setxattr(d->filePath, QStringLiteral("user.baloo.rating"), QString::number(rating)); + } else { + k_removexattr(d->filePath, QStringLiteral("user.baloo.rating")); + } + return NoError; } @@ -95,7 +105,12 @@ UserMetaData::Error UserMetaData::setUserComment(const QString& userComment) { - k_setxattr(d->filePath, QStringLiteral("user.xdg.comment"), userComment); + if (!userComment.isEmpty()) { + k_setxattr(d->filePath, QStringLiteral("user.xdg.comment"), userComment); + } else { + k_removexattr(d->filePath, QStringLiteral("user.xdg.comment")); + } + return NoError; } @@ -109,7 +124,12 @@ UserMetaData::Error UserMetaData::setOriginUrl(const QUrl &originUrl) { - k_setxattr(d->filePath, QStringLiteral("user.xdg.origin.url"), originUrl.toString()); + if (!originUrl.isEmpty()) { + k_setxattr(d->filePath, QStringLiteral("user.xdg.origin.url"), originUrl.toString()); + } else { + k_removexattr(d->filePath, QStringLiteral("user.xdg.origin.url")); + } + return NoError; } @@ -122,7 +142,12 @@ UserMetaData::Error UserMetaData::setOriginEmailSubject(const QString &originEmailSubject) { - k_setxattr(d->filePath, QStringLiteral("user.xdg.origin.email.subject"), originEmailSubject); + if (!originEmailSubject.isEmpty()) { + k_setxattr(d->filePath, QStringLiteral("user.xdg.origin.email.subject"), originEmailSubject); + } else { + k_removexattr(d->filePath, QStringLiteral("user.xdg.origin.email.subject")); + } + return NoError; } @@ -135,7 +160,12 @@ UserMetaData::Error UserMetaData::setOriginEmailSender(const QString &originEmailSender) { - k_setxattr(d->filePath, QStringLiteral("user.xdg.origin.email.sender"), originEmailSender); + if (!originEmailSender.isEmpty()) { + k_setxattr(d->filePath, QStringLiteral("user.xdg.origin.email.sender"), originEmailSender); + } else { + k_removexattr(d->filePath, QStringLiteral("user.xdg.origin.email.sender")); + } + return NoError; } @@ -148,13 +178,23 @@ UserMetaData::Error UserMetaData::setOriginEmailMessageId(const QString &originEmailMessageId) { - k_setxattr(d->filePath, QStringLiteral("user.xdg.origin.email.message-id"), originEmailMessageId); + if (!originEmailMessageId.isEmpty()) { + k_setxattr(d->filePath, QStringLiteral("user.xdg.origin.email.message-id"), originEmailMessageId); + } else { + k_removexattr(d->filePath, QStringLiteral("user.xdg.origin.email.message-id")); + } + return NoError; } UserMetaData::Error UserMetaData::setAttribute(const QString& key, const QString& value) { - k_setxattr(d->filePath, QStringLiteral("user.") + key, value); + if (!value.isEmpty()) { + k_setxattr(d->filePath, QStringLiteral("user.") + key, value); + } else { + k_removexattr(d->filePath, QStringLiteral("user.") + key); + } + return NoError; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.40.0/src/writercollection.cpp new/kfilemetadata-5.41.0/src/writercollection.cpp --- old/kfilemetadata-5.40.0/src/writercollection.cpp 2017-11-05 09:30:18.000000000 +0100 +++ new/kfilemetadata-5.41.0/src/writercollection.cpp 2017-12-02 21:04:38.000000000 +0100 @@ -21,7 +21,8 @@ * */ -#include <QDebug> +#include "kfilemetadata_debug.h" + #include <QCoreApplication> #include <QPluginLoader> #include <QDir> @@ -127,12 +128,12 @@ writers << writer; } else { - qDebug() << "Plugin could not be converted to a WriterPlugin"; - qDebug() << pluginPath; + qCDebug(KFILEMETADATA_LOG) << "Plugin could not be converted to a WriterPlugin"; + qCDebug(KFILEMETADATA_LOG) << pluginPath; } } else { - qDebug() << "Plugin could not create instance" << pluginPath; + qCDebug(KFILEMETADATA_LOG) << "Plugin could not create instance" << pluginPath; } }
