require either "procedure" or "prog" being non-NULL, not both of them at

2007-03-14  Michael Natterer  <mitch@gimp.org>

	* 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
This commit is contained in:
Michael Natterer 2007-03-14 20:03:10 +00:00 committed by Michael Natterer
parent 2e551e08fd
commit bb6530592f
3 changed files with 18 additions and 3 deletions

View File

@ -1,3 +1,14 @@
2007-03-14 Michael Natterer <mitch@gimp.org>
* 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 <sven@gimp.org>
* app/display/gimpdisplayshell-render.c: sprinkled some const

View File

@ -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));

View File

@ -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)
{