Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_meta_data_filter_p.cc
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2008 Cyrille Berger <cberger@cberger.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
8#include <QDate>
9
10#include <klocalizedstring.h>
11#include <KritaVersionWrapper.h>
12
13#include "kis_meta_data_entry.h"
16#include "kis_meta_data_store.h"
17#include "kis_meta_data_value.h"
18
19#include "kis_debug.h"
20
21using namespace KisMetaData;
22
26
28{
29 return false;
30}
31
32QString AnonymizerFilter::id() const
33{
34 return "Anonymizer";
35}
36
38{
39 return i18n("Anonymizer");
40}
41
43{
44 return i18n("Remove personal information: author, location...");
45}
46
48{
49 dbgMetaData << "Anonymize a store";
51 store->removeEntry(dcSchema, "contributor");
52 store->removeEntry(dcSchema, "creator");
53 store->removeEntry(dcSchema, "publisher");
54 store->removeEntry(dcSchema, "rights");
55
57 store->removeEntry(psSchema, "AuthorsPosition");
58 store->removeEntry(psSchema, "CaptionWriter");
59 store->removeEntry(psSchema, "Credit");
60 store->removeEntry(psSchema, "City");
61 store->removeEntry(psSchema, "Country");
62}
63
64//------------------------------------//
65//---------- ToolInfoFilter ----------//
66//------------------------------------//
67
71
73{
74 return true;
75}
76
77QString ToolInfoFilter::id() const
78{
79 return "ToolInfo";
80}
81
82QString ToolInfoFilter::name() const
83{
84 return i18n("Tool information");
85}
86
88{
89 return i18n("Add the name of the tool used for creation and the modification date");
90}
91
93{
95 store->getEntry(xmpSchema, "ModifyDate").value() = Value(QDate::currentDate());
96 store->getEntry(xmpSchema, "MetadataDate").value() = Value(QDate::currentDate());
97 if (!store->containsEntry(xmpSchema, "CreatorTool")) {
98 store->getEntry(xmpSchema, "CreatorTool").value() = Value(i18n("Krita %1", KritaVersionWrapper::versionString()));
99 }
100}
QString description() const override
void filter(KisMetaData::Store *) const override
const KisMetaData::Value & value() const
static KisMetaData::SchemaRegistry * instance()
const Schema * schemaFromUri(const QString &uri) const
static const QString PhotoshopSchemaUri
static const QString DublinCoreSchemaUri
static const QString XMPSchemaUri
void removeEntry(const QString &entryKey)
bool containsEntry(const QString &entryKey) const
Entry & getEntry(const QString &entryKey)
QString description() const override
void filter(KisMetaData::Store *) const override
#define dbgMetaData
Definition kis_debug.h:61
KRITAVERSION_EXPORT QString versionString(bool checkGit=false)