[calligra/krita-texturizer_option-rempt] krita/plugins/paintops/libpaintop: Don't save the texture options if they aren't usedO

Boudewijn Rempt boud at valdyas.org
Tue Mar 27 13:36:44 UTC 2012


Okay -- as I said before, this part of Krita is all new to me :-)

On Tue, 27 Mar 2012, Lukast dev wrote:

> Hi,
>
> I wouldn't do that. I think it is better to save the state of the
> option and and also save
> if it is checked or not.
>
> That way when you use some preset, you can enable/disable
> some subset of options quickly.
>
> And you have to save if the option is enabled.
> Otherwise some other preset where it is enabled will
> leave it enabled for the preset where it is disabled :)
>
> Dňa 26. marca 2012 21:12, Boudewijn Rempt <boud at valdyas.org> napísal/a:
>> Git commit e5b1d7f4014f451892ad98f82f17286873232c61 by Boudewijn Rempt.
>> Committed on 26/03/2012 at 21:11.
>> Pushed by rempt into branch 'krita-texturizer_option-rempt'.
>>
>> Don't save the texture options if they aren't used
>>
>> M  +3    -1    krita/plugins/paintops/libpaintop/kis_texture_option.cpp
>>
>> http://commits.kde.org/calligra/e5b1d7f4014f451892ad98f82f17286873232c61
>>
>> diff --git a/krita/plugins/paintops/libpaintop/kis_texture_option.cpp b/krita/plugins/paintops/libpaintop/kis_texture_option.cpp
>> index d247180..251a670 100644
>> --- a/krita/plugins/paintops/libpaintop/kis_texture_option.cpp
>> +++ b/krita/plugins/paintops/libpaintop/kis_texture_option.cpp
>> @@ -129,7 +129,9 @@ KisTextureOption::~KisTextureOption()
>>
>>  void KisTextureOption::writeOptionSetting(KisPropertiesConfiguration* setting) const
>>  {
>> +    if (!isChecked()) return;
>>     if (!m_optionWidget->chooser->currentResource()) return;
>> +
>>     KisPattern *pattern = static_cast<KisPattern*>(m_optionWidget->chooser->currentResource());
>>     if (!pattern) return;
>>
>> @@ -155,7 +157,6 @@ void KisTextureOption::writeOptionSetting(KisPropertiesConfiguration* setting) c
>>     setting->setProperty("Texture/Pattern/Pattern", ba.toBase64());
>>     setting->setProperty("Texture/Pattern/PatternFileName", pattern->filename());
>>     setting->setProperty("Texture/Pattern/Name", pattern->name());
>> -
>>     setting->setProperty("Texture/Pattern/Enabled", isChecked());
>>  }
>>
>> @@ -164,6 +165,7 @@ void KisTextureOption::readOptionSetting(const KisPropertiesConfiguration* setti
>>     QByteArray ba = QByteArray::fromBase64(setting->getString("Texture/Pattern/Pattern").toAscii());
>>     QImage img;
>>     img.loadFromData(ba, "PNG");
>> +
>>     QString name = setting->getString("Texture/Pattern/Name");
>>     if (name.isEmpty()) {
>>         name = setting->getString("Texture/Pattern/FileName");
>


More information about the kimageshop mailing list