File indexing completed on 2025-01-26 04:11:27

0001 /*
0002  *  SPDX-FileCopyrightText: 2022 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 #include "KisFilterOptionData.h"
0007 
0008 #include <kis_paintop_settings.h>
0009 #include <kis_properties_configuration.h>
0010 
0011 const QString FILTER_ID = "Filter/id";
0012 const QString FILTER_SMUDGE_MODE = "Filter/smudgeMode";
0013 const QString FILTER_CONFIGURATION = "Filter/configuration";
0014 
0015 bool KisFilterOptionData::read(const KisPropertiesConfiguration *setting)
0016 {
0017     filterId = setting->getString(FILTER_ID);
0018     filterConfig = setting->getString(FILTER_CONFIGURATION);
0019     smudgeMode = setting->getBool(FILTER_SMUDGE_MODE);
0020 
0021     return true;
0022 }
0023 
0024 void KisFilterOptionData::write(KisPropertiesConfiguration *setting) const
0025 {
0026     setting->setProperty(FILTER_ID, filterId);
0027     setting->setProperty(FILTER_CONFIGURATION, filterConfig);
0028     setting->setProperty(FILTER_SMUDGE_MODE, smudgeMode);
0029 }
0030 
0031 QString KisFilterOptionData::filterIdTag()
0032 {
0033     return FILTER_ID;
0034 }
0035 
0036 QString KisFilterOptionData::filterConfigTag()
0037 {
0038     return FILTER_CONFIGURATION;
0039 }
0040