[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [calligra/krita-texturizer_option-rempt] krita/plugins/paintops/libpaintop:
From:       Lukast dev <lukast.dev () gmail ! com>
Date:       2012-03-27 13:35:05
Message-ID: CAKdU0rPWyGZ4dTc=UGUbnykznvz3WTCJd-1cT_aVjHfdhKv3NQ () mail ! gmail ! com
[Download RAW message or body]

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@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");


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic