mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
libgimpbase, libgimpconfig: new GIMP_PARAM_DONT_SERIALIZE flag.
The purpose of this flag is to have some procedure arguments for which you wish to ignore last values, or restored values. This may be needed for arguments which are really volatile and likely won't survive a session (or even from a run to another). This will be used in my next commit. Note: this is very close to GIMP_CONFIG_PARAM_IGNORE, except that this latter is used for obsolete properties instead, so I felt that it may not have been the best idea to mix these semantically different flag. Also GIMP_CONFIG_PARAM_IGNORE properties are not serialized but they are deserialized, which is not exactly what we want (in most case, it would work the same, but it also means that if last-used values were to contain some deprecated value for a property for which we added this flag, there would be at least one run where a buggy behavior would happen).
This commit is contained in:
@@ -325,9 +325,10 @@ gimp_config_deserialize_property (GimpConfig *config,
|
||||
if (token == G_TOKEN_RIGHT_PAREN &&
|
||||
g_scanner_peek_next_token (scanner) == token)
|
||||
{
|
||||
if (GIMP_VALUE_HOLDS_COLOR (&value) ||
|
||||
! (G_VALUE_HOLDS_OBJECT (&value) &&
|
||||
(prop_spec->flags & GIMP_CONFIG_PARAM_AGGREGATE)))
|
||||
if (! (prop_spec->flags & GIMP_PARAM_DONT_SERIALIZE) &&
|
||||
(GIMP_VALUE_HOLDS_COLOR (&value) ||
|
||||
! (G_VALUE_HOLDS_OBJECT (&value) &&
|
||||
(prop_spec->flags & GIMP_CONFIG_PARAM_AGGREGATE))))
|
||||
g_object_set_property (G_OBJECT (config), prop_spec->name, &value);
|
||||
}
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
@@ -182,7 +182,8 @@ gimp_config_serialize_property (GimpConfig *config,
|
||||
if (! (param_spec->flags & GIMP_CONFIG_PARAM_SERIALIZE))
|
||||
return FALSE;
|
||||
|
||||
if (param_spec->flags & GIMP_CONFIG_PARAM_IGNORE)
|
||||
if (param_spec->flags & GIMP_CONFIG_PARAM_IGNORE ||
|
||||
param_spec->flags & GIMP_PARAM_DONT_SERIALIZE)
|
||||
return TRUE;
|
||||
|
||||
g_value_init (&value, param_spec->value_type);
|
||||
|
Reference in New Issue
Block a user