From f6efd0403983ad0440d7bbdb96610ee249dfe0d8 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 16 Nov 2007 18:56:10 +0000 Subject: [PATCH] add HELP log domain. 2007-11-16 Michael Natterer * app/gimp-log.[ch]: add HELP log domain. * app/widgets/gimphelp.c: port debug output to GIMP_LOG() and improve it. svn path=/trunk/; revision=24177 --- ChangeLog | 7 +++++++ app/gimp-log.c | 3 ++- app/gimp-log.h | 3 ++- app/widgets/gimphelp.c | 32 +++++++++++++++----------------- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0b7ff8a07..6383293647 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-11-16 Michael Natterer + + * app/gimp-log.[ch]: add HELP log domain. + + * app/widgets/gimphelp.c: port debug output to GIMP_LOG() and + improve it. + 2007-11-16 Tor Lillqvist * app/base/base-utils.c diff --git a/app/gimp-log.c b/app/gimp-log.c index 69e8237b46..3e8f8c7e20 100644 --- a/app/gimp-log.c +++ b/app/gimp-log.c @@ -36,7 +36,8 @@ gimp_log_init (void) const GDebugKey log_keys[] = { { "tools", GIMP_LOG_TOOLS }, - { "dnd", GIMP_LOG_DND } + { "dnd", GIMP_LOG_DND }, + { "help", GIMP_LOG_HELP } }; gimp_log_flags = g_parse_debug_string (env_log_val, diff --git a/app/gimp-log.h b/app/gimp-log.h index ec54ad7eb1..c15abdf5e3 100644 --- a/app/gimp-log.h +++ b/app/gimp-log.h @@ -23,7 +23,8 @@ typedef enum { GIMP_LOG_TOOLS = 1 << 0, - GIMP_LOG_DND = 1 << 1 + GIMP_LOG_DND = 1 << 1, + GIMP_LOG_HELP = 1 << 2 } GimpLogFlags; diff --git a/app/widgets/gimphelp.c b/app/widgets/gimphelp.c index 20f9478b2e..f1dc2acf21 100644 --- a/app/widgets/gimphelp.c +++ b/app/widgets/gimphelp.c @@ -47,12 +47,10 @@ #include "gimpmessagebox.h" #include "gimpmessagedialog.h" +#include "gimp-log.h" #include "gimp-intl.h" -/* #define GIMP_HELP_DEBUG */ - - typedef struct _GimpIdleHelp GimpIdleHelp; struct _GimpIdleHelp @@ -127,12 +125,9 @@ gimp_idle_help (GimpIdleHelp *idle_help) GimpGuiConfig *config = GIMP_GUI_CONFIG (idle_help->gimp->config); const gchar *procedure_name = NULL; -#ifdef GIMP_HELP_DEBUG - g_printerr ("Help Domain: %s\n", - idle_help->help_domain ? idle_help->help_domain : "NULL"); - g_printerr ("Help ID: %s\n\n", - idle_help->help_id ? idle_help->help_id : "NULL"); -#endif + GIMP_LOG (HELP, "Domain = '%s', ID = '%s'", + idle_help->help_domain ? idle_help->help_domain : "NULL", + idle_help->help_id ? idle_help->help_id : "NULL"); if (config->help_browser == GIMP_HELP_BROWSER_GIMP) { @@ -290,6 +285,12 @@ gimp_help_call (Gimp *gimp, { GValueArray *return_vals; + GIMP_LOG (HELP, "Calling help via %s: %s %s %s", + procedure_name, + help_domain ? help_domain : "(null)", + help_locales ? help_locales : "(null)", + help_id ? help_id : "(null)"); + return_vals = gimp_pdb_execute_procedure_by_name (gimp->pdb, gimp_get_user_context (gimp), @@ -347,13 +348,11 @@ gimp_help_call (Gimp *gimp, { GValueArray *return_vals; -#ifdef GIMP_HELP_DEBUG - g_printerr ("Calling help via %s: %s %s %s\n", - procedure_name, - help_domain ? help_domain : "(null)", - help_locales ? help_locales : "(null)", - help_id ? help_id : "(null)"); -#endif + GIMP_LOG (HELP, "Calling help via %s: %s %s %s", + procedure_name, + help_domain ? help_domain : "(null)", + help_locales ? help_locales : "(null)", + help_id ? help_id : "(null)"); return_vals = gimp_pdb_execute_procedure_by_name (gimp->pdb, @@ -378,4 +377,3 @@ gimp_help_get_locales (GimpGuiConfig *config) return g_strjoinv (":", (gchar **) g_get_language_names ()); } - -- GitLab