From 119356a692edcdaea1a830752d498bae7e880923 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 20 Jun 2003 14:13:15 +0000 Subject: [PATCH] use plug_in_get_undo_desc() instead of duplicating its code. 2003-06-20 Michael Natterer * tools/pdbgen/pdb/message.pdb (message): use plug_in_get_undo_desc() instead of duplicating its code. * app/pdb/message_cmds.c: regenerated. --- ChangeLog | 7 ++++++ app/pdb/message_cmds.c | 41 +---------------------------------- tools/pdbgen/pdb/message.pdb | 42 ++---------------------------------- 3 files changed, 10 insertions(+), 80 deletions(-) diff --git a/ChangeLog b/ChangeLog index eabcf52cf2..65b4f58d5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-06-20 Michael Natterer + + * tools/pdbgen/pdb/message.pdb (message): use + plug_in_get_undo_desc() instead of duplicating its code. + + * app/pdb/message_cmds.c: regenerated. + 2003-06-20 Michael Natterer * app/gui/plug-in-commands.c (plug_in_run_cmd_callback): pass the diff --git a/app/pdb/message_cmds.c b/app/pdb/message_cmds.c index d7a1c160f6..f1e8fb9d80 100644 --- a/app/pdb/message_cmds.c +++ b/app/pdb/message_cmds.c @@ -31,9 +31,7 @@ #include "core/gimp.h" #include "gimp-intl.h" -#include "plug-in/plug-in-proc.h" #include "plug-in/plug-in.h" -#include "plug-in/plug-ins.h" static ProcRecord message_proc; static ProcRecord message_get_handler_proc; @@ -70,44 +68,7 @@ message_invoker (Gimp *gimp, gchar *domain = NULL; if (gimp->current_plug_in) - { - GSList *list; - - for (list = gimp->plug_in_proc_defs; list; list = g_slist_next (list)) - { - PlugInProcDef *proc_def = list->data; - - if (&proc_def->db_info == gimp->current_plug_in->proc_rec) - { - const gchar *progname; - - progname = plug_in_proc_def_get_progname (proc_def); - - if (proc_def->menu_path) - { - const gchar *path; - gchar *ellipses; - - path = dgettext (plug_ins_locale_domain (gimp, progname, - NULL), - proc_def->menu_path); - - domain = g_path_get_basename (path); - - ellipses = strstr (domain, "..."); - - if (ellipses && ellipses == (domain + strlen (domain) - 3)) - *ellipses = '\0'; - } - else - { - domain = g_path_get_basename (progname); - } - - break; - } - } - } + domain = plug_in_get_undo_desc (gimp->current_plug_in); gimp_message (gimp, domain, message); diff --git a/tools/pdbgen/pdb/message.pdb b/tools/pdbgen/pdb/message.pdb index 5b1a152c1a..0943ca25c8 100644 --- a/tools/pdbgen/pdb/message.pdb +++ b/tools/pdbgen/pdb/message.pdb @@ -49,44 +49,7 @@ HELP gchar *domain = NULL; if (gimp->current_plug_in) - { - GSList *list; - - for (list = gimp->plug_in_proc_defs; list; list = g_slist_next (list)) - { - PlugInProcDef *proc_def = list->data; - - if (&proc_def->db_info == gimp->current_plug_in->proc_rec) - { - const gchar *progname; - - progname = plug_in_proc_def_get_progname (proc_def); - - if (proc_def->menu_path) - { - const gchar *path; - gchar *ellipses; - - path = dgettext (plug_ins_locale_domain (gimp, progname, - NULL), - proc_def->menu_path); - - domain = g_path_get_basename (path); - - ellipses = strstr (domain, "..."); - - if (ellipses && ellipses == (domain + strlen (domain) - 3)) - *ellipses = '\\0'; - } - else - { - domain = g_path_get_basename (progname); - } - - break; - } - } - } + domain = plug_in_get_undo_desc (gimp->current_plug_in); gimp_message (gimp, domain, message); @@ -134,8 +97,7 @@ HELP %invoke = ( code => 'gimp->message_handler = handler;' ); } -@headers = qw( "core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-ins.h" - "plug-in/plug-in-proc.h" "gimp-intl.h"); +@headers = qw( "core/gimp.h" "plug-in/plug-in.h" "gimp-intl.h"); @procs = qw(message message_get_handler message_set_handler); %exports = (app => [@procs], lib => [@procs]);