Commit 2e103fa8 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

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.
parent db407228
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
......
......@@ -39,6 +39,7 @@ struct _PlugInProcDef
GSList *prefixes_list;
GSList *magics_list;
time_t mtime;
gboolean installed_during_init;
};
......
......@@ -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;
......
......@@ -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;
......
......@@ -39,6 +39,7 @@ struct _PlugInProcDef
GSList *prefixes_list;
GSList *magics_list;
time_t mtime;
gboolean installed_during_init;
};
......
......@@ -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;
......
......@@ -39,6 +39,7 @@ struct _PlugInProcDef
GSList *prefixes_list;
GSList *magics_list;
time_t mtime;
gboolean installed_during_init;
};
......
......@@ -39,6 +39,7 @@ struct _PlugInProcDef
GSList *prefixes_list;
GSList *magics_list;
time_t mtime;
gboolean installed_during_init;
};
......
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment