From 2f8cf53bb1e565e18b0e5afd8e41d6f27db5efbd Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 7 Apr 2008 09:12:07 +0000 Subject: [PATCH] canonicalize the procedure name and also try compat names. 2008-04-07 Sven Neumann * tools/pdbgen/pdb/procedural_db.pdb (procedural_db_proc_exists): canonicalize the procedure name and also try compat names. * app/pdb/procedural-db-cmds.c: regenerated. svn path=/trunk/; revision=25386 --- ChangeLog | 7 +++++++ app/pdb/procedural-db-cmds.c | 19 ++++++++++++++++++- tools/pdbgen/pdb/procedural_db.pdb | 19 ++++++++++++++++++- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc1cc2db43..6039cffd6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-07 Sven Neumann + + * tools/pdbgen/pdb/procedural_db.pdb (procedural_db_proc_exists): + canonicalize the procedure name and also try compat names. + + * app/pdb/procedural-db-cmds.c: regenerated. + 2008-04-06 Sven Neumann * tools/pdbgen/pdb/procedural_db.pdb: added new procedure diff --git a/app/pdb/procedural-db-cmds.c b/app/pdb/procedural-db-cmds.c index 256db402e6..1be4ec6599 100644 --- a/app/pdb/procedural-db-cmds.c +++ b/app/pdb/procedural-db-cmds.c @@ -145,7 +145,24 @@ procedural_db_proc_exists_invoker (GimpProcedure *procedure, if (success) { - exists = (gimp_pdb_lookup_procedure (gimp->pdb, procedure_name) != NULL); + GimpProcedure *procedure; + gchar *canonical; + + canonical = gimp_canonicalize_identifier (procedure_name); + + procedure = gimp_pdb_lookup_procedure (gimp->pdb, canonical); + + if (! procedure) + { + procedure_name = gimp_pdb_lookup_compat_proc_name (gimp->pdb, canonical); + + if (procedure_name) + procedure = gimp_pdb_lookup_procedure (gimp->pdb, procedure_name); + } + + g_free (canonical); + + exists = (procedure != NULL); } return_vals = gimp_procedure_get_return_values (procedure, success); diff --git a/tools/pdbgen/pdb/procedural_db.pdb b/tools/pdbgen/pdb/procedural_db.pdb index dca5310605..3c8930ed65 100644 --- a/tools/pdbgen/pdb/procedural_db.pdb +++ b/tools/pdbgen/pdb/procedural_db.pdb @@ -156,7 +156,24 @@ HELP %invoke = ( code => <<'CODE' { - exists = (gimp_pdb_lookup_procedure (gimp->pdb, procedure_name) != NULL); + GimpProcedure *procedure; + gchar *canonical; + + canonical = gimp_canonicalize_identifier (procedure_name); + + procedure = gimp_pdb_lookup_procedure (gimp->pdb, canonical); + + if (! procedure) + { + procedure_name = gimp_pdb_lookup_compat_proc_name (gimp->pdb, canonical); + + if (procedure_name) + procedure = gimp_pdb_lookup_procedure (gimp->pdb, procedure_name); + } + + g_free (canonical); + + exists = (procedure != NULL); } CODE );