app/plug-in/plug-in-message.c (plug_in_handle_proc_install)

2004-04-15  Tor Lillqvist  <tml@iki.fi>

	* app/plug-in/plug-in-message.c (plug_in_handle_proc_install)
	* app/plug-in/plug-in-proc.h (struct _PlugInProcDef)
	* app/plug-in/plug-in-rc.c (plug_in_rc_write)
	* app/plug-in/plug-ins.c (plug_ins_init): Make PDB procedures
	(including their menu entries) installed during a plug-ins init()
	phase show up. Add a flag to PlugInProcDef that tells whether the
	proc was installed during the init() phase. Such procs aren't
	saved to the pluginrc. Move the code that initializes plug-ins
	that need initialization earlier, before the procs are added to
	the PDB and menus are built. Fixes bug #139969.
This commit is contained in:
Tor Lillqvist 2004-04-15 22:16:21 +00:00 committed by Tor Lillqvist
parent db40722817
commit 2e103fa8b1
10 changed files with 78 additions and 52 deletions

View File

@ -1,3 +1,16 @@
2004-04-15 Tor Lillqvist <tml@iki.fi>
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install)
* app/plug-in/plug-in-proc.h (struct _PlugInProcDef)
* app/plug-in/plug-in-rc.c (plug_in_rc_write)
* app/plug-in/plug-ins.c (plug_ins_init): Make PDB procedures
(including their menu entries) installed during a plug-ins init()
phase show up. Add a flag to PlugInProcDef that tells whether the
proc was installed during the init() phase. Such procs aren't
saved to the pluginrc. Move the code that initializes plug-ins
that need initialization earlier, before the procs are added to
the PDB and menus are built. Fixes bug #139969.
2004-04-16 Sven Neumann <sven@gimp.org>
* plug-ins/common/Makefile.am

View File

@ -39,6 +39,7 @@ struct _PlugInProcDef
GSList *prefixes_list;
GSList *magics_list;
time_t mtime;
gboolean installed_during_init;
};

View File

@ -757,6 +757,9 @@ plug_in_handle_proc_install (PlugIn *plug_in,
/* Install temp one use todays time */
proc_def->mtime = time (NULL);
/* Remember if this proc was installed while initing a plug-in */
proc_def->installed_during_init = plug_in->init;
/* The procedural database procedure */
proc = &proc_def->db_info;

View File

@ -174,6 +174,32 @@ plug_ins_init (Gimp *gimp,
(* status_callback) (NULL, NULL, 1.0);
/* initialize the plug-ins */
(* status_callback) (_("Initializing Plug-ins"), "", 0);
for (tmp = gimp->plug_in_defs, nth = 0;
tmp;
tmp = g_slist_next (tmp), nth++)
{
PlugInDef *plug_in_def = tmp->data;
basename = g_path_get_basename (plug_in_def->prog);
(* status_callback) (NULL, gimp_filename_to_utf8 (basename),
nth / n_plugins);
g_free (basename);
if (plug_in_def->has_init)
{
if (gimp->be_verbose)
g_print (_("Initializing plug-in: '%s'\n"),
gimp_filename_to_utf8 (plug_in_def->prog));
plug_in_call_init (gimp, context, plug_in_def);
}
}
(* status_callback) (NULL, NULL, 1.0);
/* insert the proc defs */
for (tmp = gimp->plug_in_defs; tmp; tmp = g_slist_next (tmp))
{
@ -300,32 +326,6 @@ plug_ins_init (Gimp *gimp,
if (! gimp->no_interface)
gimp_menus_init (gimp, gimp->plug_in_defs, STD_PLUGINS_DOMAIN);
/* initial the plug-ins */
(* status_callback) (_("Initializing Plug-ins"), "", 0);
for (tmp = gimp->plug_in_defs, nth = 0;
tmp;
tmp = g_slist_next (tmp), nth++)
{
PlugInDef *plug_in_def = tmp->data;
basename = g_path_get_basename (plug_in_def->prog);
(* status_callback) (NULL, gimp_filename_to_utf8 (basename),
nth / n_plugins);
g_free (basename);
if (plug_in_def->has_init)
{
if (gimp->be_verbose)
g_print (_("Initializing plug-in: '%s'\n"),
gimp_filename_to_utf8 (plug_in_def->prog));
plug_in_call_init (gimp, context, plug_in_def);
}
}
(* status_callback) (NULL, NULL, 1.0);
/* build list of automatically started extensions */
for (tmp = gimp->plug_in_proc_defs, nth = 0;
tmp;

View File

@ -39,6 +39,7 @@ struct _PlugInProcDef
GSList *prefixes_list;
GSList *magics_list;
time_t mtime;
gboolean installed_during_init;
};

View File

@ -757,6 +757,9 @@ plug_in_handle_proc_install (PlugIn *plug_in,
/* Install temp one use todays time */
proc_def->mtime = time (NULL);
/* Remember if this proc was installed while initing a plug-in */
proc_def->installed_during_init = plug_in->init;
/* The procedural database procedure */
proc = &proc_def->db_info;

View File

@ -39,6 +39,7 @@ struct _PlugInProcDef
GSList *prefixes_list;
GSList *magics_list;
time_t mtime;
gboolean installed_during_init;
};

View File

@ -39,6 +39,7 @@ struct _PlugInProcDef
GSList *prefixes_list;
GSList *magics_list;
time_t mtime;
gboolean installed_during_init;
};

View File

@ -455,6 +455,9 @@ plug_in_rc_write (GSList *plug_in_defs,
{
proc_def = list2->data;
if (proc_def->installed_during_init)
continue;
gimp_config_writer_open (writer, "proc-def");
gimp_config_writer_printf (writer, "\"%s\" %d",
proc_def->db_info.name,

View File

@ -174,6 +174,32 @@ plug_ins_init (Gimp *gimp,
(* status_callback) (NULL, NULL, 1.0);
/* initialize the plug-ins */
(* status_callback) (_("Initializing Plug-ins"), "", 0);
for (tmp = gimp->plug_in_defs, nth = 0;
tmp;
tmp = g_slist_next (tmp), nth++)
{
PlugInDef *plug_in_def = tmp->data;
basename = g_path_get_basename (plug_in_def->prog);
(* status_callback) (NULL, gimp_filename_to_utf8 (basename),
nth / n_plugins);
g_free (basename);
if (plug_in_def->has_init)
{
if (gimp->be_verbose)
g_print (_("Initializing plug-in: '%s'\n"),
gimp_filename_to_utf8 (plug_in_def->prog));
plug_in_call_init (gimp, context, plug_in_def);
}
}
(* status_callback) (NULL, NULL, 1.0);
/* insert the proc defs */
for (tmp = gimp->plug_in_defs; tmp; tmp = g_slist_next (tmp))
{
@ -300,32 +326,6 @@ plug_ins_init (Gimp *gimp,
if (! gimp->no_interface)
gimp_menus_init (gimp, gimp->plug_in_defs, STD_PLUGINS_DOMAIN);
/* initial the plug-ins */
(* status_callback) (_("Initializing Plug-ins"), "", 0);
for (tmp = gimp->plug_in_defs, nth = 0;
tmp;
tmp = g_slist_next (tmp), nth++)
{
PlugInDef *plug_in_def = tmp->data;
basename = g_path_get_basename (plug_in_def->prog);
(* status_callback) (NULL, gimp_filename_to_utf8 (basename),
nth / n_plugins);
g_free (basename);
if (plug_in_def->has_init)
{
if (gimp->be_verbose)
g_print (_("Initializing plug-in: '%s'\n"),
gimp_filename_to_utf8 (plug_in_def->prog));
plug_in_call_init (gimp, context, plug_in_def);
}
}
(* status_callback) (NULL, NULL, 1.0);
/* build list of automatically started extensions */
for (tmp = gimp->plug_in_proc_defs, nth = 0;
tmp;