From 07196f371b3975603196d8ae491a089e5c65e288 Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 3 Aug 2024 01:30:21 +0200 Subject: [PATCH] Issue #11865: properly pass ui_meta() from GeglParamColor to GimpParamColor. --- app/operations/gimp-operation-config.c | 39 ++++++++++++++++++-------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/app/operations/gimp-operation-config.c b/app/operations/gimp-operation-config.c index f42924ac4e..ec850cf166 100644 --- a/app/operations/gimp-operation-config.c +++ b/app/operations/gimp-operation-config.c @@ -152,18 +152,35 @@ gimp_operation_config_get_type (Gimp *gimp, strcmp (pspec->name, "output")) { if (GEGL_IS_PARAM_SPEC_COLOR (pspec)) - /* As special exception, let's transform GeglParamColor - * into GimpParamColor in all core code. This way, we - * have one less param type to handle. - */ - pspecs[j] = gimp_param_spec_color (pspec->name, - g_param_spec_get_nick (pspec), - g_param_spec_get_blurb (pspec), - TRUE, - gegl_param_spec_color_get_default (pspec), - pspec->flags); + { + /* As special exception, let's transform GeglParamColor + * into GimpParamColor in all core code. This way, we + * have one less param type to handle. + */ + gchar **prop_keys; + guint n_keys = 0; + + pspecs[j] = gimp_param_spec_color (pspec->name, + g_param_spec_get_nick (pspec), + g_param_spec_get_blurb (pspec), + TRUE, + gegl_param_spec_color_get_default (pspec), + pspec->flags); + prop_keys = gegl_operation_list_property_keys (operation, pspec->name, &n_keys); + for (gint k = 0; k < n_keys; k++) + { + const gchar *key; + + key = gegl_param_spec_get_property_key (pspec, prop_keys[k]); + gegl_param_spec_set_property_key (pspecs[j], prop_keys[k], key); + } + + g_free (prop_keys); + } else - pspecs[j] = pspec; + { + pspecs[j] = pspec; + } j++; }