1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Niels De Graef
758ff03d28 gimpprocedure: Use less strict typechecking
When executing `GimpProcedure.run()`, we perform some type checking
(and sometimes even do more validation) to make sure that plug-ins are
behaving correctly.

The problem with the current implementation was that a plug-in that
accepted for example a single `GimpDrawable` as argument, then trying to
call this with a value of `GIMP_TYPE_CHANNEL` didn't pass the
validation, even though the latter is just a subclass of the former.

For that reason, do a proper typecheck using `g_type_is_a()`.
2020-08-17 23:23:17 +02:00

View File

@@ -1911,7 +1911,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
GType arg_type = G_VALUE_TYPE (arg);
GType spec_type = G_PARAM_SPEC_VALUE_TYPE (pspec);
if (arg_type != spec_type)
if (! g_type_is_a (arg_type, spec_type))
{
if (return_vals)
{