File indexing completed on 2025-01-19 03:50:57

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2024-02-11
0007  * Description : a BQM plugin to apply metadata with ExifTool
0008  *
0009  * SPDX-FileCopyrightText: 2024 by Maik Qualmann <metzpinguin at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #include "applymetadataplugin.h"
0016 
0017 // Qt includes
0018 
0019 #include <QPointer>
0020 #include <QString>
0021 #include <QApplication>
0022 
0023 // KDE includes
0024 
0025 #include <klocalizedstring.h>
0026 
0027 // Local includes
0028 
0029 #include "digikam_debug.h"
0030 #include "applymetadata.h"
0031 
0032 namespace DigikamBqmApplyMetadataPlugin
0033 {
0034 
0035 ApplyMetadataPlugin::ApplyMetadataPlugin(QObject* const parent)
0036     : DPluginBqm(parent)
0037 {
0038 }
0039 
0040 ApplyMetadataPlugin::~ApplyMetadataPlugin()
0041 {
0042 }
0043 
0044 QString ApplyMetadataPlugin::name() const
0045 {
0046     return i18nc("@title", "Apply Metadata");
0047 }
0048 
0049 QString ApplyMetadataPlugin::iid() const
0050 {
0051     return QLatin1String(DPLUGIN_IID);
0052 }
0053 
0054 QIcon ApplyMetadataPlugin::icon() const
0055 {
0056     return QIcon::fromTheme(QLatin1String("format-text-code"));
0057 }
0058 
0059 QString ApplyMetadataPlugin::description() const
0060 {
0061     return i18nc("@info", "A tool to apply metadata from a image or JSON file with ExifTool");
0062 }
0063 
0064 QString ApplyMetadataPlugin::details() const
0065 {
0066     return xi18nc("@info", "<para>This Batch Queue Manager tool can apply metadata "
0067                            "from a image or JSON file with ExifTool.</para>");
0068 }
0069 
0070 QString ApplyMetadataPlugin::handbookSection() const
0071 {
0072     return QLatin1String("batch_queue");
0073 }
0074 
0075 QString ApplyMetadataPlugin::handbookChapter() const
0076 {
0077     return QLatin1String("metadata_tools");
0078 }
0079 
0080 QString ApplyMetadataPlugin::handbookReference() const
0081 {
0082     return QLatin1String("");
0083 }
0084 
0085 QList<DPluginAuthor> ApplyMetadataPlugin::authors() const
0086 {
0087     return QList<DPluginAuthor>()
0088             << DPluginAuthor(QString::fromUtf8("Maik Qualmann"),
0089                              QString::fromUtf8("metzpinguin at gmail dot com"),
0090                              QString::fromUtf8("(C) 2024"))
0091             ;
0092 }
0093 
0094 void ApplyMetadataPlugin::setup(QObject* const parent)
0095 {
0096     ApplyMetadata* const tool = new ApplyMetadata(parent);
0097     tool->setPlugin(this);
0098 
0099     addTool(tool);
0100 }
0101 
0102 } // namespace DigikamBqmApplyMetadataPlugin
0103 
0104 #include "moc_applymetadataplugin.cpp"