libgimpconfig: add GIMP_CONFIG_PARAM_DONT_COMPARE flag

... which excludes a property from comparison in the default
implementation of GimpConfig::equal().
This commit is contained in:
Ell 2020-04-08 00:10:42 +03:00
parent d25cddae8c
commit c5c807d191
3 changed files with 14 additions and 4 deletions

View file

@ -25,8 +25,8 @@
#include "gimpobject.h" #include "gimpobject.h"
/* shift one more than GIMP_CONFIG_PARAM_IGNORE */ /* shift one more than GIMP_CONFIG_PARAM_DONT_COMPARE */
#define GIMP_SYMMETRY_PARAM_GUI (1 << (6 + G_PARAM_USER_SHIFT)) #define GIMP_SYMMETRY_PARAM_GUI (GIMP_CONFIG_PARAM_DONT_COMPARE << 1)
#define GIMP_TYPE_SYMMETRY (gimp_symmetry_get_type ()) #define GIMP_TYPE_SYMMETRY (gimp_symmetry_get_type ())

View file

@ -220,8 +220,11 @@ gimp_config_iface_equal (GimpConfig *a,
prop_spec = property_specs[i]; prop_spec = property_specs[i];
if (! (prop_spec->flags & G_PARAM_READABLE)) if (! (prop_spec->flags & G_PARAM_READABLE) ||
(prop_spec->flags & GIMP_CONFIG_PARAM_DONT_COMPARE))
{
continue; continue;
}
g_value_init (&a_value, prop_spec->value_type); g_value_init (&a_value, prop_spec->value_type);
g_value_init (&b_value, prop_spec->value_type); g_value_init (&b_value, prop_spec->value_type);

View file

@ -76,6 +76,13 @@ G_BEGIN_DECLS
**/ **/
#define GIMP_CONFIG_PARAM_IGNORE (1 << (5 + G_PARAM_USER_SHIFT)) #define GIMP_CONFIG_PARAM_IGNORE (1 << (5 + G_PARAM_USER_SHIFT))
/**
* GIMP_CONFIG_PARAM_DONT_COMPARE:
*
* Ignore this property when comparing objects.
**/
#define GIMP_CONFIG_PARAM_DONT_COMPARE (1 << (6 + G_PARAM_USER_SHIFT))
/** /**
* GIMP_CONFIG_PARAM_FLAGS: * GIMP_CONFIG_PARAM_FLAGS:
* *