From bb6530592f3f374d88977f9ba1b828ecba385b3c Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 14 Mar 2007 20:03:10 +0000 Subject: [PATCH] require either "procedure" or "prog" being non-NULL, not both of them at 2007-03-14 Michael Natterer * app/plug-in/gimpplugin.c (gimp_plug_in_new): require either "procedure" or "prog" being non-NULL, not both of them at the same time. Get the executable name from the procedure if the procedure was passed. * app/plug-in/gimppluginmanager-call.c (gimp_plug_in_manager_call_run): pass a NULL prog since we already pass the procedure. svn path=/trunk/; revision=22122 --- ChangeLog | 11 +++++++++++ app/plug-in/gimpplugin.c | 8 ++++++-- app/plug-in/gimppluginmanager-call.c | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9478d83200..7803190ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-03-14 Michael Natterer + + * app/plug-in/gimpplugin.c (gimp_plug_in_new): require either + "procedure" or "prog" being non-NULL, not both of them at the same + time. Get the executable name from the procedure if the procedure + was passed. + + * app/plug-in/gimppluginmanager-call.c + (gimp_plug_in_manager_call_run): pass a NULL prog since we already + pass the procedure. + 2007-03-14 Sven Neumann * app/display/gimpdisplayshell-render.c: sprinkled some const diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index cb1b00a386..37e23c70c2 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -188,11 +188,15 @@ gimp_plug_in_new (GimpPlugInManager *manager, g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL); g_return_val_if_fail (procedure == NULL || GIMP_IS_PLUG_IN_PROCEDURE (procedure), NULL); - g_return_val_if_fail (prog != NULL, NULL); - g_return_val_if_fail (g_path_is_absolute (prog), NULL); + g_return_val_if_fail (prog == NULL || g_path_is_absolute (prog), NULL); + g_return_val_if_fail ((procedure != NULL || prog != NULL) && + ! (procedure != NULL && prog != NULL), NULL); plug_in = g_object_new (GIMP_TYPE_PLUG_IN, NULL); + if (! prog) + prog = gimp_plug_in_procedure_get_progname (procedure); + gimp_object_take_name (GIMP_OBJECT (plug_in), g_filename_display_basename (prog)); diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index 16b70fd878..b394eabfdb 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -154,7 +154,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager *manager, g_return_val_if_fail (display == NULL || GIMP_IS_OBJECT (display), NULL); plug_in = gimp_plug_in_new (manager, context, progress, - procedure, procedure->prog); + procedure, NULL); if (plug_in) {