From 751665a7bd92c7201cdbf852dd30ccc31adc9eb3 Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 19 Jan 2025 17:51:45 +0100 Subject: [PATCH] app: gimp_pdb_query() in libgimp doesn't return private procedures anymore. A main consequence of this is that the Procedure Browser plug-in in GIMP doesn't show now private PDB procedures. I was always finding this annoying as their presence in the procedure browser would encourage people to use these in plug-ins and scripts (even when sometimes we added explicit description that these should not be used). Now it's clearer. The procedure are much more hidden to plug-in developers (and if they still use them, it's at their own risk, especially of having broken plug-ins when we change signature of these as they are not meant to be used, and therefore we don't promise stability for these). --- app/pdb/gimppdb-query.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/pdb/gimppdb-query.c b/app/pdb/gimppdb-query.c index d8e27cde99..d351f954de 100644 --- a/app/pdb/gimppdb-query.c +++ b/app/pdb/gimppdb-query.c @@ -69,6 +69,7 @@ struct _PDBQuery gchar **list_of_procs; gboolean querying_compat; + gboolean querying_private; }; typedef struct _PDBStrings PDBStrings; @@ -213,9 +214,10 @@ gimp_pdb_query (GimpPDB *pdb, success = TRUE; - pdb_query.pdb = pdb; - pdb_query.list_of_procs = g_new0 (gchar *, 1); - pdb_query.querying_compat = FALSE; + pdb_query.pdb = pdb; + pdb_query.list_of_procs = g_new0 (gchar *, 1); + pdb_query.querying_private = FALSE; + pdb_query.querying_compat = FALSE; g_hash_table_foreach (pdb->procedures, gimp_pdb_query_entry, &pdb_query); @@ -293,6 +295,8 @@ gimp_pdb_query_entry (gpointer key, return; procedure = list->data; + if (! pdb_query->querying_private && procedure->is_private) + return; gimp_pdb_get_strings (&strings, procedure, pdb_query->querying_compat);