File indexing completed on 2025-01-19 03:55:56

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2006-02-23
0007  * Description : item metadata interface
0008  *
0009  * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2006-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0011  * SPDX-FileCopyrightText: 2011      by Leif Huhn <leif at dkstat dot com>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #include "dmetadata.h"
0018 
0019 // Local includes
0020 
0021 #include "metaenginesettings.h"
0022 #include "digikam_version.h"
0023 #include "digikam_globals.h"
0024 #include "digikam_debug.h"
0025 
0026 namespace Digikam
0027 {
0028 
0029 DMetadata::DMetadata()
0030     : MetaEngine()
0031 {
0032     registerMetadataSettings();
0033 }
0034 
0035 DMetadata::DMetadata(const QString& filePath)
0036     : MetaEngine()
0037 {
0038     registerMetadataSettings();
0039     load(filePath);
0040 }
0041 
0042 DMetadata::DMetadata(const MetaEngineData& data)
0043     : MetaEngine(data)
0044 {
0045     registerMetadataSettings();
0046 }
0047 
0048 DMetadata::~DMetadata()
0049 {
0050 }
0051 
0052 void DMetadata::registerMetadataSettings()
0053 {
0054     setSettings(MetaEngineSettings::instance()->settings());
0055 }
0056 
0057 void DMetadata::setSettings(const MetaEngineSettingsContainer& settings)
0058 {
0059     setUseXMPSidecar4Reading(settings.useXMPSidecar4Reading);
0060     setUseCompatibleFileName(settings.useCompatibleFileName);
0061     setWriteWithExifTool(settings.writeWithExifTool);
0062     setWriteRawFiles(settings.writeRawFiles);
0063     setWriteDngFiles(settings.writeDngFiles);
0064     setMetadataWritingMode(settings.metadataWritingMode);
0065     setUpdateFileTimeStamp(settings.updateFileTimeStamp);
0066 }
0067 
0068 } // namespace Digikam