Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kfilemetadata5 for openSUSE:Factory checked in at 2022-03-14 19:34:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kfilemetadata5 (Old) and /work/SRC/openSUSE:Factory/.kfilemetadata5.new.25692 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kfilemetadata5" Mon Mar 14 19:34:25 2022 rev:106 rq:961244 version:5.92.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kfilemetadata5/kfilemetadata5.changes 2022-02-24 18:21:43.446686021 +0100 +++ /work/SRC/openSUSE:Factory/.kfilemetadata5.new.25692/kfilemetadata5.changes 2022-03-14 19:35:49.202036722 +0100 @@ -1,0 +2,12 @@ +Mon Mar 7 09:26:53 UTC 2022 - Christophe Giboudeaux <[email protected]> + +- Update to 5.92.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.92.0 +- Changes since 5.91.0: + * Port to KPluginMetaData::findPlugins for plugin querying + * enable mobipocket extractor by default + * Use std::unique_ptr to manage lifetime of d-ptr + +------------------------------------------------------------------- Old: ---- kfilemetadata-5.91.0.tar.xz kfilemetadata-5.91.0.tar.xz.sig New: ---- kfilemetadata-5.92.0.tar.xz kfilemetadata-5.92.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kfilemetadata5.spec ++++++ --- /var/tmp/diff_new_pack.lBfvVQ/_old 2022-03-14 19:35:49.858037509 +0100 +++ /var/tmp/diff_new_pack.lBfvVQ/_new 2022-03-14 19:35:49.862037514 +0100 @@ -16,7 +16,7 @@ # -%define _tar_path 5.91 +%define _tar_path 5.92 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) @@ -24,7 +24,7 @@ %bcond_without ffmpeg %bcond_without released Name: kfilemetadata5 -Version: 5.91.0 +Version: 5.92.0 Release: 0 Summary: Library for extracting Metadata License: GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-3.0-only @@ -44,11 +44,11 @@ BuildRequires: taglib-devel >= 1.9 BuildRequires: cmake(KF5Archive) >= %{_kf5_bugfix_version} BuildRequires: cmake(KF5CoreAddons) >= %{_kf5_bugfix_version} +BuildRequires: cmake(KF5Config) >= %{_kf5_bugfix_version} BuildRequires: cmake(KF5I18n) >= %{_kf5_bugfix_version} BuildRequires: cmake(Qt5Test) >= 5.15.0 BuildRequires: cmake(Qt5Xml) >= 5.15.0 BuildRequires: pkgconfig(poppler-qt5) -Recommends: %{name}-lang %if %{with ffmpeg} BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavformat) ++++++ kfilemetadata-5.91.0.tar.xz -> kfilemetadata-5.92.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/CMakeLists.txt new/kfilemetadata-5.92.0/CMakeLists.txt --- old/kfilemetadata-5.91.0/CMakeLists.txt 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/CMakeLists.txt 2022-03-05 14:00:22.000000000 +0100 @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.16) -set(KF_VERSION "5.91.0") # handled by release scripts -set(KF_DEP_VERSION "5.91.0") # handled by release scripts +set(KF_VERSION "5.92.0") # handled by release scripts +set(KF_DEP_VERSION "5.92.0") # handled by release scripts project(KFileMetaData VERSION ${KF_VERSION}) include(FeatureSummary) -find_package(ECM 5.91.0 NO_MODULE) +find_package(ECM 5.92.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) @@ -102,10 +102,10 @@ PURPOSE "Extended attribute shared library") endif() -#find_package(QMobipocket 2.0) -#set_package_properties(QMobipocket PROPERTIES DESCRIPTION "Mobipocket epub reader" -# URL "https://cgit.kde.org/kdegraphics-mobipocket.git" -# TYPE OPTIONAL PURPOSE "Support for mobi metadata") +find_package(QMobipocket 2.0) +set_package_properties(QMobipocket PROPERTIES DESCRIPTION "Mobipocket epub reader" + URL "https://invent.kde.org/graphics/kdegraphics-mobipocket" + TYPE OPTIONAL PURPOSE "Support for mobi metadata") find_package(libappimage 0.1.10 CONFIG) set_package_properties(libappimage PROPERTIES DESCRIPTION "Core library of the AppImage project" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/po/ar/kfilemetadata5.po new/kfilemetadata-5.92.0/po/ar/kfilemetadata5.po --- old/kfilemetadata-5.91.0/po/ar/kfilemetadata5.po 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/po/ar/kfilemetadata5.po 2022-03-05 14:00:22.000000000 +0100 @@ -8,7 +8,7 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2020-06-09 02:02+0200\n" -"PO-Revision-Date: 2022-01-05 22:58+0400\n" +"PO-Revision-Date: 2022-02-12 11:59+0400\n" "Last-Translator: Zayed Al-Saidi <[email protected]>\n" "Language-Team: ar\n" "Language: ar\n" @@ -137,13 +137,13 @@ #, kde-format msgctxt "Description of photo flash" msgid "No, auto" -msgstr "" +msgstr "?????? ??????" #: src/formatstrings.cpp:107 #, kde-format msgctxt "Description of photo flash" msgid "Yes, auto" -msgstr "" +msgstr "???????? ??????" #: src/formatstrings.cpp:108 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/po/zh_CN/kfilemetadata5.po new/kfilemetadata-5.92.0/po/zh_CN/kfilemetadata5.po --- old/kfilemetadata-5.91.0/po/zh_CN/kfilemetadata5.po 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/po/zh_CN/kfilemetadata5.po 2022-03-05 14:00:22.000000000 +0100 @@ -10,7 +10,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2020-06-09 02:02+0200\n" -"PO-Revision-Date: 2022-01-08 15:22\n" +"PO-Revision-Date: 2022-02-26 05:16\n" "Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" @@ -340,7 +340,7 @@ #, kde-format msgctxt "@label" msgid "Bitrate" -msgstr "?????????" +msgstr "??????" #: src/propertyinfo.cpp:87 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/externalextractor.cpp new/kfilemetadata-5.92.0/src/externalextractor.cpp --- old/kfilemetadata-5.91.0/src/externalextractor.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/externalextractor.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -20,16 +20,18 @@ #define EXTRACTOR_TIMEOUT_MS 30000 -using namespace KFileMetaData; - -class Q_DECL_HIDDEN ExternalExtractor::ExternalExtractorPrivate +namespace KFileMetaData +{ +class ExternalExtractorPrivate { public: QString path; QStringList writeMimetypes; QString mainPath; }; +} +using namespace KFileMetaData; ExternalExtractor::ExternalExtractor(QObject* parent) : ExtractorPlugin(parent), @@ -74,10 +76,7 @@ d->mainPath = pluginDir.filePath(rootObject[QStringLiteral("main")].toString()); } -ExternalExtractor::~ExternalExtractor() -{ - delete d_ptr; -} +ExternalExtractor::~ExternalExtractor() = default; QStringList ExternalExtractor::mimetypes() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/externalextractor.h new/kfilemetadata-5.92.0/src/externalextractor.h --- old/kfilemetadata-5.91.0/src/externalextractor.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/externalextractor.h 2022-03-05 14:00:22.000000000 +0100 @@ -11,7 +11,7 @@ #include "extractorplugin.h" namespace KFileMetaData { - +class ExternalExtractorPrivate; class ExternalExtractor : public ExtractorPlugin { @@ -26,8 +26,7 @@ void extract(ExtractionResult* result) override; private: - class ExternalExtractorPrivate; - ExternalExtractorPrivate *d_ptr; + std::unique_ptr<ExternalExtractorPrivate> d_ptr; Q_DECLARE_PRIVATE(ExternalExtractor) }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/externalwriter.cpp new/kfilemetadata-5.92.0/src/externalwriter.cpp --- old/kfilemetadata-5.91.0/src/externalwriter.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/externalwriter.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -20,7 +20,7 @@ using namespace KFileMetaData; -class Q_DECL_HIDDEN ExternalWriter::ExternalWriterPrivate +class KFileMetaData::ExternalWriterPrivate { public: QString path; @@ -35,11 +35,6 @@ { } -ExternalWriter::~ExternalWriter() -{ - delete d_ptr; -} - ExternalWriter::ExternalWriter(const QString& pluginPath) : WriterPlugin(nullptr), d_ptr(new ExternalWriterPrivate) @@ -74,6 +69,8 @@ d->mainPath = pluginDir.filePath(rootObject[QStringLiteral("main")].toString()); } +ExternalWriter::~ExternalWriter() = default; + QStringList ExternalWriter::writeMimetypes() const { Q_D(const ExternalWriter); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/externalwriter.h new/kfilemetadata-5.92.0/src/externalwriter.h --- old/kfilemetadata-5.91.0/src/externalwriter.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/externalwriter.h 2022-03-05 14:00:22.000000000 +0100 @@ -11,10 +11,9 @@ #include "writerplugin.h" namespace KFileMetaData { - +class ExternalWriterPrivate; class ExternalWriter : public WriterPlugin { - Q_OBJECT public: @@ -29,8 +28,7 @@ bool runtimeInstalled() const; bool dependenciesSatisfied() const; - class ExternalWriterPrivate; - ExternalWriterPrivate *d_ptr; + std::unique_ptr<ExternalWriterPrivate> d_ptr; Q_DECLARE_PRIVATE(ExternalWriter) }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractionresult.cpp new/kfilemetadata-5.92.0/src/extractionresult.cpp --- old/kfilemetadata-5.91.0/src/extractionresult.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractionresult.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -8,7 +8,7 @@ using namespace KFileMetaData; -class Q_DECL_HIDDEN ExtractionResult::Private +class KFileMetaData::ExtractionResultPrivate { public: QString url; @@ -18,7 +18,7 @@ }; ExtractionResult::ExtractionResult(const QString& url, const QString& mimetype, const Flags& flags) - : d(new Private) + : d(new ExtractionResultPrivate) { d->url = url; d->mimetype = mimetype; @@ -26,14 +26,11 @@ } ExtractionResult::ExtractionResult(const ExtractionResult& rhs) - : d(new Private(*rhs.d)) + : d(new ExtractionResultPrivate(*rhs.d)) { } -ExtractionResult::~ExtractionResult() -{ - delete d; -} +ExtractionResult::~ExtractionResult() = default; QString ExtractionResult::inputUrl() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractionresult.h new/kfilemetadata-5.92.0/src/extractionresult.h --- old/kfilemetadata-5.91.0/src/extractionresult.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractionresult.h 2022-03-05 14:00:22.000000000 +0100 @@ -10,13 +10,15 @@ #include <QString> #include <QVariant> +#include <memory> + #include "kfilemetadata_export.h" #include "embeddedimagedata.h" #include "properties.h" #include "types.h" namespace KFileMetaData { - +class ExtractionResultPrivate; /** * \class ExtractionResult extractionresult.h <KFileMetaData/ExtractionResult> * @@ -128,8 +130,7 @@ QMap<EmbeddedImageData::ImageType, QByteArray> imageData() const; private: - class Private; - Private* d; + const std::unique_ptr<ExtractionResultPrivate> d; }; Q_DECLARE_OPERATORS_FOR_FLAGS(ExtractionResult::Flags) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractor.cpp new/kfilemetadata-5.92.0/src/extractor.cpp --- old/kfilemetadata-5.91.0/src/extractor.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractor.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -8,6 +8,8 @@ #include "extractor_p.h" #include "extractorplugin.h" +#include <utility> + using namespace KFileMetaData; Extractor::Extractor() @@ -15,15 +17,11 @@ { } -Extractor::~Extractor() -{ - delete d; -} +Extractor::~Extractor() = default; Extractor::Extractor(Extractor&& other) { - d = other.d; - other.d = nullptr; + d = std::move(other.d); } void Extractor::extract(ExtractionResult* result) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractor.h new/kfilemetadata-5.92.0/src/extractor.h --- old/kfilemetadata-5.91.0/src/extractor.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractor.h 2022-03-05 14:00:22.000000000 +0100 @@ -11,19 +11,20 @@ #include <QStringList> #include <QVariantMap> +#include <memory> + namespace KFileMetaData { class ExtractionResult; class ExtractorCollection; class ExtractorPlugin; +class ExtractorPrivate; /** * \class Extractor extractor.h <KFileMetaData/Extractor> */ class KFILEMETADATA_EXPORT Extractor { - class ExtractorPrivate; - enum ExtractorPluginOwnership { AutoDeletePlugin, DoNotDeletePlugin, @@ -49,8 +50,10 @@ void setMetaData(const QVariantMap &metaData); - ExtractorPrivate *d; friend class ExtractorCollection; + friend class ExtractorCollectionPrivate; + friend class ExtractorPrivate; + std::unique_ptr<ExtractorPrivate> d; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractor_p.h new/kfilemetadata-5.92.0/src/extractor_p.h --- old/kfilemetadata-5.91.0/src/extractor_p.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractor_p.h 2022-03-05 14:00:22.000000000 +0100 @@ -15,11 +15,11 @@ class ExtractorPlugin; -class Extractor::ExtractorPrivate +class ExtractorPrivate { public: ~ExtractorPrivate() { - if (m_autoDeletePlugin == AutoDeletePlugin) { + if (m_autoDeletePlugin == Extractor::AutoDeletePlugin) { delete m_plugin; } } @@ -27,13 +27,13 @@ ExtractorPlugin *m_plugin = nullptr; - ExtractorPluginOwnership m_autoDeletePlugin = AutoDeletePlugin; + Extractor::ExtractorPluginOwnership m_autoDeletePlugin = Extractor::AutoDeletePlugin; QVariantMap m_metaData; QString m_pluginPath; }; -inline bool Extractor::ExtractorPrivate::initPlugin() +inline bool ExtractorPrivate::initPlugin() { if (m_plugin) { return true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractorcollection.cpp new/kfilemetadata-5.92.0/src/extractorcollection.cpp --- old/kfilemetadata-5.91.0/src/extractorcollection.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractorcollection.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -12,15 +12,15 @@ #include "kfilemetadata_debug.h" #include "config-kfilemetadata.h" -#include <QMimeDatabase> +#include <KPluginMetaData> #include <QCoreApplication> -#include <QPluginLoader> #include <QDir> +#include <QMimeDatabase> #include <vector> using namespace KFileMetaData; -class Q_DECL_HIDDEN ExtractorCollection::Private +class KFileMetaData::ExtractorCollectionPrivate { public: QMultiHash<QString, Extractor*> m_mimeExtractors; @@ -32,15 +32,12 @@ }; ExtractorCollection::ExtractorCollection() - : d(new Private) + : d(new ExtractorCollectionPrivate) { d->findExtractors(); } -ExtractorCollection::~ExtractorCollection() -{ - delete d; -} +ExtractorCollection::~ExtractorCollection() = default; QList<Extractor*> ExtractorCollection::allExtractors() @@ -54,86 +51,40 @@ return plugins; } -void ExtractorCollection::Private::findExtractors() +void ExtractorCollectionPrivate::findExtractors() { - QStringList plugins; - QStringList externalPlugins; - - const QStringList paths = QCoreApplication::libraryPaths(); - for (const QString& libraryPath : paths) { - QString path(libraryPath + QStringLiteral("/kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/kfilemetadata")); - QDir dir(path); - qCDebug(KFILEMETADATA_LOG) << "Searching for extractors:" << dir.path(); - - if (!dir.exists()) { - continue; - } - - const QStringList entryList = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); - for (const QString& fileName : entryList) { - if (!QLibrary::isLibrary(fileName)) { - continue; - } - // Make sure the same plugin is not loaded twice, even if it is - // installed in two different locations - if (plugins.contains(fileName)) { - qCDebug(KFILEMETADATA_LOG) << "Skipping duplicate - " << path << ":" << fileName; - continue; - } - - plugins << fileName; + const QVector<KPluginMetaData> kfilemetadataPlugins = + KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR) "/kfilemetadata"), {}, KPluginMetaData::AllowEmptyMetaData); + for (const KPluginMetaData &plugin : kfilemetadataPlugins) { + Extractor extractor; + extractor.d->m_pluginPath = plugin.fileName(); + extractor.setAutoDeletePlugin(Extractor::DoNotDeletePlugin); - Extractor extractor; - extractor.setAutoDeletePlugin(Extractor::DoNotDeletePlugin); - auto pluginPath = dir.absoluteFilePath(fileName); - - QPluginLoader loader(pluginPath); - auto metadata = loader.metaData().value(QLatin1String("MetaData")); - if (metadata.type() == QJsonValue::Object) { - qCDebug(KFILEMETADATA_LOG) << "Found plugin with metadata:" << metadata.toObject(); - auto pluginProperties = metadata.toObject().toVariantMap(); - extractor.setMetaData(pluginProperties); - extractor.d->m_pluginPath = pluginPath; + if (!plugin.rawData().isEmpty()) { + qCDebug(KFILEMETADATA_LOG) << "Found plugin with metadata:" << extractor.d->m_pluginPath; + extractor.setMetaData(plugin.rawData().toVariantMap()); + m_allExtractors.push_back(std::move(extractor)); + } else { + qCDebug(KFILEMETADATA_LOG) << "Found plugin without metadata:" << extractor.d->m_pluginPath; + if (extractor.d->initPlugin() && !extractor.mimetypes().isEmpty()) { m_allExtractors.push_back(std::move(extractor)); - } else { - qCDebug(KFILEMETADATA_LOG) << "Found plugin without metadata:" << pluginPath; - extractor.d->m_pluginPath = pluginPath; - if (extractor.d->initPlugin() && !extractor.mimetypes().isEmpty()) { - m_allExtractors.push_back(std::move(extractor)); - } } } } - plugins.clear(); - QDir externalPluginDir(QStringLiteral(LIBEXEC_INSTALL_DIR) + QStringLiteral("/kfilemetadata/externalextractors")); - qCDebug(KFILEMETADATA_LOG) << "Searching for external extractors:" << externalPluginDir.path(); - // For external plugins, we look into the directories - const QStringList externalPluginEntryList = externalPluginDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); - for (const QString& externalPlugin : externalPluginEntryList) { - if (!QLibrary::isLibrary(externalPlugin)) { - continue; - } - if (externalPlugins.contains(externalPlugin)) { - qCDebug(KFILEMETADATA_LOG) << "Skipping duplicate - " - << externalPluginDir.path() << ":" << externalPlugin; - continue; - } - - qCDebug(KFILEMETADATA_LOG) << "Adding plugin - " << externalPluginDir.path() << ":" << externalPlugin; - externalPlugins << externalPlugin; + const QVector<KPluginMetaData> externalExtractors = + KPluginMetaData::findPlugins(QStringLiteral(LIBEXEC_INSTALL_DIR "/kfilemetadata/externalextractors"), {}, KPluginMetaData::AllowEmptyMetaData); + for (const KPluginMetaData &externalPlugin : externalExtractors) { + qCDebug(KFILEMETADATA_LOG) << "Adding plugin - " << externalPlugin.fileName(); Extractor extractor; - auto pluginPath = externalPluginDir.absoluteFilePath(externalPlugin); - - ExternalExtractor *plugin = new ExternalExtractor(pluginPath); + ExternalExtractor *plugin = new ExternalExtractor(externalPlugin.fileName()); if (plugin && !plugin->mimetypes().isEmpty()) { extractor.setExtractorPlugin(plugin); extractor.setAutoDeletePlugin(Extractor::AutoDeletePlugin); m_allExtractors.push_back(std::move(extractor)); } } - externalPlugins.clear(); for (Extractor& extractor : m_allExtractors) { auto pluginProperties = extractor.extractorProperties(); @@ -152,7 +103,7 @@ } } -QList<Extractor*> ExtractorCollection::Private::getExtractors(const QString& mimetype) +QList<Extractor*> ExtractorCollectionPrivate::getExtractors(const QString& mimetype) { QList<Extractor*> extractors = m_mimeExtractors.values(mimetype); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractorcollection.h new/kfilemetadata-5.92.0/src/extractorcollection.h --- old/kfilemetadata-5.91.0/src/extractorcollection.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractorcollection.h 2022-03-05 14:00:22.000000000 +0100 @@ -10,8 +10,11 @@ #include "extractor.h" #include "kfilemetadata_export.h" +#include <memory> + namespace KFileMetaData { +class ExtractorCollectionPrivate; /** * \class ExtractorCollection extractorcollection.h <KFileMetaData/ExtractorCollection> * @@ -42,11 +45,9 @@ QList<Extractor*> fetchExtractors(const QString& mimetype) const; private: - class Private; - Private* d; - friend class ExtractorCollectionTest; QList<Extractor*> allExtractors(); + const std::unique_ptr<ExtractorCollectionPrivate> d; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractorplugin.h new/kfilemetadata-5.92.0/src/extractorplugin.h --- old/kfilemetadata-5.91.0/src/extractorplugin.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractorplugin.h 2022-03-05 14:00:22.000000000 +0100 @@ -95,8 +95,8 @@ QString getSupportedMimeType(const QString& mimetype) const; private: - class Private; - Private* d; + class ExtractorPluginPrivate; + ExtractorPluginPrivate *d_placeholder; // Placeholder for future binary compatible extensions }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/extractors/mobiextractor.cpp new/kfilemetadata-5.92.0/src/extractors/mobiextractor.cpp --- old/kfilemetadata-5.91.0/src/extractors/mobiextractor.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/extractors/mobiextractor.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -13,6 +13,7 @@ #include <qmobipocket/mobipocket.h> #include <QFile> +#include <QTextDocument> using namespace KFileMetaData; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/propertyinfo.cpp new/kfilemetadata-5.92.0/src/propertyinfo.cpp --- old/kfilemetadata-5.91.0/src/propertyinfo.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/propertyinfo.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -15,7 +15,7 @@ using namespace KFileMetaData; -class Q_DECL_HIDDEN PropertyInfo::Private +class KFileMetaData::PropertyInfoPrivate { public: Property::Property prop; @@ -27,7 +27,7 @@ }; PropertyInfo::PropertyInfo() - : d(new Private) + : d(new PropertyInfoPrivate) { d->prop = Property::Empty; d->name = QStringLiteral("empty"); @@ -37,7 +37,7 @@ } PropertyInfo::PropertyInfo(Property::Property property) - : d(new Private) + : d(new PropertyInfoPrivate) { d->prop = property; d->shouldBeIndexed = true; @@ -577,14 +577,11 @@ } PropertyInfo::PropertyInfo(const PropertyInfo& pi) - : d(new Private(*pi.d)) + : d(new PropertyInfoPrivate(*pi.d)) { } -PropertyInfo::~PropertyInfo() -{ - delete d; -} +PropertyInfo::~PropertyInfo() = default; PropertyInfo& PropertyInfo::operator=(const PropertyInfo& rhs) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/propertyinfo.h new/kfilemetadata-5.92.0/src/propertyinfo.h --- old/kfilemetadata-5.91.0/src/propertyinfo.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/propertyinfo.h 2022-03-05 14:00:22.000000000 +0100 @@ -13,8 +13,11 @@ #include "properties.h" #include "kfilemetadata_export.h" +#include <memory> + namespace KFileMetaData { +class PropertyInfoPrivate; /** * \class PropertyInfo propertyinfo.h <KFileMetaData/PropertyInfo> * @@ -79,8 +82,7 @@ QString formatAsDisplayString(const QVariant& value) const; private: - class Private; - Private* d; + const std::unique_ptr<PropertyInfoPrivate> d; }; } // namespace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/simpleextractionresult.cpp new/kfilemetadata-5.92.0/src/simpleextractionresult.cpp --- old/kfilemetadata-5.91.0/src/simpleextractionresult.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/simpleextractionresult.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -8,7 +8,7 @@ using namespace KFileMetaData; -class Q_DECL_HIDDEN SimpleExtractionResult::Private +class KFileMetaData::SimpleExtractionResultPrivate { public: PropertyMultiMap m_properties; @@ -18,20 +18,17 @@ SimpleExtractionResult::SimpleExtractionResult(const QString& url, const QString& mimetype, const Flags& flags) : ExtractionResult(url, mimetype, flags) - , d(new Private) + , d(new SimpleExtractionResultPrivate) { } SimpleExtractionResult::SimpleExtractionResult(const SimpleExtractionResult& rhs) : ExtractionResult(*this) - , d(new Private(*rhs.d)) + , d(new SimpleExtractionResultPrivate(*rhs.d)) { } -SimpleExtractionResult::~SimpleExtractionResult() -{ - delete d; -} +SimpleExtractionResult::~SimpleExtractionResult() = default; SimpleExtractionResult& SimpleExtractionResult::operator=(const SimpleExtractionResult& rhs) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/simpleextractionresult.h new/kfilemetadata-5.92.0/src/simpleextractionresult.h --- old/kfilemetadata-5.91.0/src/simpleextractionresult.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/simpleextractionresult.h 2022-03-05 14:00:22.000000000 +0100 @@ -11,9 +11,13 @@ #include <QVector> #include <QString> +#include <memory> + namespace KFileMetaData { enum PropertiesMapType { MultiMap }; +class SimpleExtractionResultPrivate; + /** * \class SimpleExtractionResult simpleextractionresult.h <KFileMetaData/SimpleExtractionResult> * @@ -65,8 +69,7 @@ QVector<Type::Type> types() const; private: - class Private; - Private* d; + const std::unique_ptr<SimpleExtractionResultPrivate> d; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/typeinfo.cpp new/kfilemetadata-5.92.0/src/typeinfo.cpp --- old/kfilemetadata-5.91.0/src/typeinfo.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/typeinfo.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -10,7 +10,7 @@ using namespace KFileMetaData; -class Q_DECL_HIDDEN TypeInfo::Private +class KFileMetaData::TypeInfoPrivate { public: Type::Type type; @@ -19,7 +19,7 @@ }; TypeInfo::TypeInfo(Type::Type type) - : d(new Private) + : d(new TypeInfoPrivate) { d->type = type; @@ -77,14 +77,11 @@ } TypeInfo::TypeInfo(const TypeInfo& ti) - : d(new Private(*ti.d)) + : d(new TypeInfoPrivate(*ti.d)) { } -TypeInfo::~TypeInfo() -{ - delete d; -} +TypeInfo::~TypeInfo() = default; TypeInfo& TypeInfo::operator=(const TypeInfo& rhs) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/typeinfo.h new/kfilemetadata-5.92.0/src/typeinfo.h --- old/kfilemetadata-5.91.0/src/typeinfo.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/typeinfo.h 2022-03-05 14:00:22.000000000 +0100 @@ -10,9 +10,11 @@ #include "types.h" #include "kfilemetadata_export.h" #include <QString> +#include <memory> namespace KFileMetaData { +class TypeInfoPrivate; /** * \class TypeInfo typeinfo.h <KFileMetaData/TypeInfo> */ @@ -59,8 +61,7 @@ static TypeInfo fromName(const QString& name); private: - class Private; - Private* d; + const std::unique_ptr<TypeInfoPrivate> d; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/usermetadata.cpp new/kfilemetadata-5.92.0/src/usermetadata.cpp --- old/kfilemetadata-5.91.0/src/usermetadata.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/usermetadata.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -10,27 +10,24 @@ using namespace KFileMetaData; -class Q_DECL_HIDDEN UserMetaData::Private +class KFileMetaData::UserMetaDataPrivate { public: QString filePath; }; UserMetaData::UserMetaData(const QString& filePath) - : d(new Private) + : d(new UserMetaDataPrivate) { d->filePath = filePath; } UserMetaData::UserMetaData(const UserMetaData& rhs) - : d(new Private(*rhs.d)) + : d(new UserMetaDataPrivate(*rhs.d)) { } -UserMetaData::~UserMetaData() -{ - delete d; -} +UserMetaData::~UserMetaData() = default; const UserMetaData& UserMetaData::operator=(const UserMetaData& rhs) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/usermetadata.h new/kfilemetadata-5.92.0/src/usermetadata.h --- old/kfilemetadata-5.91.0/src/usermetadata.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/usermetadata.h 2022-03-05 14:00:22.000000000 +0100 @@ -11,8 +11,11 @@ #include <QStringList> #include <QUrl> +#include <memory> + namespace KFileMetaData { +class UserMetaDataPrivate; /** * \class UserMetaData usermetadata.h <KFileMetaData/UserMetaData> */ @@ -93,8 +96,7 @@ Attributes queryAttributes(Attributes attributes = Attribute::Any) const; private: - class Private; - Private *d; + const std::unique_ptr<UserMetaDataPrivate> d; }; Q_DECLARE_OPERATORS_FOR_FLAGS(UserMetaData::Attributes) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/writedata.cpp new/kfilemetadata-5.92.0/src/writedata.cpp --- old/kfilemetadata-5.91.0/src/writedata.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/writedata.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -12,7 +12,7 @@ using namespace KFileMetaData; -class Q_DECL_HIDDEN WriteData::WriteDataPrivate +class KFileMetaData::WriteDataPrivate { public: QString url; @@ -68,10 +68,7 @@ return d->images; } -WriteData::~WriteData() -{ - delete d_ptr; -} +WriteData::~WriteData() = default; QString WriteData::inputUrl() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/writedata.h new/kfilemetadata-5.92.0/src/writedata.h --- old/kfilemetadata-5.91.0/src/writedata.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/writedata.h 2022-03-05 14:00:22.000000000 +0100 @@ -20,7 +20,7 @@ #include "types.h" namespace KFileMetaData { - +class WriteDataPrivate; /** * \class WriteData writedata.h <KFileMetaData/WriteData> */ @@ -52,8 +52,7 @@ QMap<EmbeddedImageData::ImageType, QByteArray> imageData() const; private: - class WriteDataPrivate; - WriteDataPrivate* d_ptr; + std::unique_ptr<WriteDataPrivate> d_ptr; Q_DECLARE_PRIVATE(WriteData) }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/writer.cpp new/kfilemetadata-5.92.0/src/writer.cpp --- old/kfilemetadata-5.91.0/src/writer.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/writer.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -17,15 +17,11 @@ { } -Writer::~Writer() -{ - delete d; -} +Writer::~Writer() = default; Writer::Writer(Writer&& other) { - d = other.d; - other.d = nullptr; + d = std::move(other.d); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/writer.h new/kfilemetadata-5.92.0/src/writer.h --- old/kfilemetadata-5.91.0/src/writer.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/writer.h 2022-03-05 14:00:22.000000000 +0100 @@ -12,19 +12,20 @@ #include "kfilemetadata_export.h" #include <QStringList> +#include <memory> + namespace KFileMetaData { class WriteData; class WriterCollection; +class WriterPrivate; /** * \class Writer writer.h <KFileMetaData/Writer> */ class KFILEMETADATA_EXPORT Writer { - class WriterPrivate; - enum WriterPluginOwnership { AutoDeletePlugin, DoNotDeletePlugin, @@ -45,8 +46,9 @@ void setAutoDeletePlugin(WriterPluginOwnership autoDelete); - WriterPrivate *d; - friend class WriterCollection; + std::unique_ptr<WriterPrivate> d; + friend class WriterPrivate; + friend class WriterCollectionPrivate; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/writer_p.h new/kfilemetadata-5.92.0/src/writer_p.h --- old/kfilemetadata-5.91.0/src/writer_p.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/writer_p.h 2022-03-05 14:00:22.000000000 +0100 @@ -15,18 +15,18 @@ class WriterPlugin; -class Writer::WriterPrivate +class WriterPrivate { public: ~WriterPrivate() { - if (m_autoDeletePlugin == AutoDeletePlugin) { + if (m_autoDeletePlugin == Writer::AutoDeletePlugin) { delete m_plugin; } } WriterPlugin *m_plugin = nullptr; - WriterPluginOwnership m_autoDeletePlugin = AutoDeletePlugin; + Writer::WriterPluginOwnership m_autoDeletePlugin = Writer::AutoDeletePlugin; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/writercollection.cpp new/kfilemetadata-5.92.0/src/writercollection.cpp --- old/kfilemetadata-5.91.0/src/writercollection.cpp 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/writercollection.cpp 2022-03-05 14:00:22.000000000 +0100 @@ -13,15 +13,16 @@ #include "kfilemetadata_debug.h" #include "config-kfilemetadata.h" +#include <KPluginMetaData> #include <QCoreApplication> -#include <QPluginLoader> #include <QDir> #include <QMimeDatabase> +#include <QPluginLoader> #include <vector> using namespace KFileMetaData; -class Q_DECL_HIDDEN WriterCollection::WriterCollectionPrivate +class KFileMetaData::WriterCollectionPrivate { public: QMultiHash<QString, Writer*> m_writers; @@ -37,46 +38,34 @@ d->findWriters(); } -WriterCollection::~WriterCollection() -{ - delete d; -} +WriterCollection::~WriterCollection() = default; -void WriterCollection::WriterCollectionPrivate::findWriters() +void WriterCollectionPrivate::findWriters() { - QStringList plugins; - QStringList pluginPaths; - QStringList externalPlugins; - QStringList externalPluginPaths; - - const QStringList paths = QCoreApplication::libraryPaths(); - for (const QString& libraryPath : paths) { - QString path(libraryPath + QStringLiteral("/kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/kfilemetadata/writers")); - QDir dir(path); + const auto internalPlugins = KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/kfilemetadata/writers"), {}, KPluginMetaData::AllowEmptyMetaData); - if (!dir.exists()) { - continue; - } + for (const KPluginMetaData &metaData : internalPlugins) { + QPluginLoader loader(metaData.fileName()); + if (QObject *obj = loader.instance()) { + if (WriterPlugin *plugin = qobject_cast<WriterPlugin *>(obj)) { + Writer writer; + writer.d->m_plugin = plugin; + writer.setAutoDeletePlugin(Writer::DoNotDeletePlugin); - const QStringList entryList = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); - for (const QString& fileName : entryList) { - if (!QLibrary::isLibrary(fileName)) { - continue; - } - // Make sure the same plugin is not loaded twice, even if it - // installed in two different locations - if (plugins.contains(fileName)) { - continue; + m_allWriters.push_back(std::move(writer)); + } else { + qCDebug(KFILEMETADATA_LOG) << "Plugin could not be converted to a WriterPlugin"; + qCDebug(KFILEMETADATA_LOG) << metaData.fileName(); } - - plugins << fileName; - pluginPaths << dir.absoluteFilePath(fileName); + } else { + qCDebug(KFILEMETADATA_LOG) << "Plugin could not create instance" << metaData.fileName(); } } - plugins.clear(); + QStringList externalPlugins; + QStringList externalPluginPaths; QDir externalPluginDir(QStringLiteral(LIBEXEC_INSTALL_DIR) + QStringLiteral("/kfilemetadata/writers/externalwriters")); - // For external plugins, we look into the directories + // For external plugins, we look into the directories. Those are executables and not C++ plugins. const QStringList externalPluginEntryList = externalPluginDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); for (const QString& externalPlugin : externalPluginEntryList) { if (!QLibrary::isLibrary(externalPlugin)) { @@ -89,35 +78,6 @@ externalPlugins << externalPlugin; externalPluginPaths << externalPluginDir.absoluteFilePath(externalPlugin); } - externalPlugins.clear(); - - for (const QString& pluginPath : std::as_const(pluginPaths)) { - QPluginLoader loader(pluginPath); - - if (!loader.load()) { - qCWarning(KFILEMETADATA_LOG) << "Could not create Writer: " << pluginPath; - qCWarning(KFILEMETADATA_LOG) << loader.errorString(); - continue; - } - - QObject* obj = loader.instance(); - if (obj) { - WriterPlugin* plugin = qobject_cast<WriterPlugin*>(obj); - if (plugin) { - Writer writer; - writer.d->m_plugin = plugin; - writer.setAutoDeletePlugin(Writer::DoNotDeletePlugin); - - m_allWriters.push_back(std::move(writer)); - } else { - qCDebug(KFILEMETADATA_LOG) << "Plugin could not be converted to a WriterPlugin"; - qCDebug(KFILEMETADATA_LOG) << pluginPath; - } - } - else { - qCDebug(KFILEMETADATA_LOG) << "Plugin could not create instance" << pluginPath; - } - } for (const QString& externalPluginPath : std::as_const(externalPluginPaths)) { ExternalWriter *plugin = new ExternalWriter(externalPluginPath); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kfilemetadata-5.91.0/src/writercollection.h new/kfilemetadata-5.92.0/src/writercollection.h --- old/kfilemetadata-5.91.0/src/writercollection.h 2022-02-05 22:23:09.000000000 +0100 +++ new/kfilemetadata-5.92.0/src/writercollection.h 2022-03-05 14:00:22.000000000 +0100 @@ -11,12 +11,14 @@ #include <QList> +#include <memory> + #include "kfilemetadata_export.h" #include "writer.h" namespace KFileMetaData { - +class WriterCollectionPrivate; /** * \class WriterCollection writercollection.h <KFileMetaData/WriterCollection> */ @@ -29,8 +31,7 @@ QList<Writer*> fetchWriters(const QString& mimetype) const; private: - class WriterCollectionPrivate; - WriterCollectionPrivate* d; + const std::unique_ptr<WriterCollectionPrivate> d; }; }
