use g_clear_error() instead of g_error_free() and re-use the same GError

2004-02-03  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-ins.c (plug_ins_init): use g_clear_error()
	instead of g_error_free() and re-use the same GError location for
	pluginrc parsing and writing.

	(plug_ins_proc_def_insert): when overriding a PlugInProcDef, don't
	take over the menu_path and menu_accel of the overridden proc
	because (a) it's just plain wrong and (b) we don't need to
	preserve the proc_defs' order any more (see below).
This commit is contained in:
Michael Natterer 2004-02-03 15:12:11 +00:00 committed by Michael Natterer
parent b147234460
commit 9af8d8c55e
3 changed files with 15 additions and 30 deletions

View File

@ -1,3 +1,14 @@
2004-02-03 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-ins.c (plug_ins_init): use g_clear_error()
instead of g_error_free() and re-use the same GError location for
pluginrc parsing and writing.
(plug_ins_proc_def_insert): when overriding a PlugInProcDef, don't
take over the menu_path and menu_accel of the overridden proc
because (a) it's just plain wrong and (b) we don't need to
preserve the proc_defs' order any more (see below).
2004-02-03 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-proc.[ch]: added new function

View File

@ -133,7 +133,7 @@ plug_ins_init (Gimp *gimp,
if (! plug_in_rc_parse (gimp, filename, &error))
{
g_message (error->message);
g_error_free (error);
g_clear_error (&error);
}
/* Query any plug-ins that have changed since we last wrote out
@ -215,8 +215,6 @@ plug_ins_init (Gimp *gimp,
/* write the pluginrc file if necessary */
if (gimp->write_pluginrc)
{
GError *error = NULL;
if (gimp->be_verbose)
g_print (_("Writing '%s'\n"),
gimp_filename_to_utf8 (filename));
@ -224,7 +222,7 @@ plug_ins_init (Gimp *gimp,
if (! plug_in_rc_write (gimp->plug_in_defs, filename, &error))
{
g_message ("%s", error->message);
g_error_free (error);
g_clear_error (&error);
}
gimp->write_pluginrc = FALSE;
@ -975,17 +973,6 @@ plug_ins_proc_def_insert (Gimp *gimp,
{
list->data = proc_def;
if (proc_def->menu_path)
g_free (proc_def->menu_path);
if (proc_def->accelerator)
g_free (proc_def->accelerator);
proc_def->menu_path = tmp_proc_def->menu_path;
proc_def->accelerator = tmp_proc_def->accelerator;
tmp_proc_def->menu_path = NULL;
tmp_proc_def->accelerator = NULL;
return tmp_proc_def;
}
}

View File

@ -133,7 +133,7 @@ plug_ins_init (Gimp *gimp,
if (! plug_in_rc_parse (gimp, filename, &error))
{
g_message (error->message);
g_error_free (error);
g_clear_error (&error);
}
/* Query any plug-ins that have changed since we last wrote out
@ -215,8 +215,6 @@ plug_ins_init (Gimp *gimp,
/* write the pluginrc file if necessary */
if (gimp->write_pluginrc)
{
GError *error = NULL;
if (gimp->be_verbose)
g_print (_("Writing '%s'\n"),
gimp_filename_to_utf8 (filename));
@ -224,7 +222,7 @@ plug_ins_init (Gimp *gimp,
if (! plug_in_rc_write (gimp->plug_in_defs, filename, &error))
{
g_message ("%s", error->message);
g_error_free (error);
g_clear_error (&error);
}
gimp->write_pluginrc = FALSE;
@ -975,17 +973,6 @@ plug_ins_proc_def_insert (Gimp *gimp,
{
list->data = proc_def;
if (proc_def->menu_path)
g_free (proc_def->menu_path);
if (proc_def->accelerator)
g_free (proc_def->accelerator);
proc_def->menu_path = tmp_proc_def->menu_path;
proc_def->accelerator = tmp_proc_def->accelerator;
tmp_proc_def->menu_path = NULL;
tmp_proc_def->accelerator = NULL;
return tmp_proc_def;
}
}