Commit 6ee66007 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

add SAVE_DIALOG log domain.

2007-11-18  Michael Natterer  <mitch@gimp.org>

	* app/gimp-log.[ch]: add SAVE_DIALOG log domain.

	* app/dialogs/file-save-dialog: port debug output to GIMP_LOG().


svn path=/trunk/; revision=24186
parent f4621424
2007-11-18 Michael Natterer <mitch@gimp.org>
* app/gimp-log.[ch]: add SAVE_DIALOG log domain.
* app/dialogs/file-save-dialog: port debug output to GIMP_LOG().
2007-11-18 Michael Natterer <mitch@gimp.org> 2007-11-18 Michael Natterer <mitch@gimp.org>
* app/gimp-log.[ch]: add DIALOG_FACTORY log domain. * app/gimp-log.[ch]: add DIALOG_FACTORY log domain.
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "file-save-dialog.h" #include "file-save-dialog.h"
#include "gimp-log.h"
#include "gimp-intl.h" #include "gimp-intl.h"
...@@ -218,18 +219,13 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -218,18 +219,13 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
/* first check if the user entered an extension at all */ /* first check if the user entered an extension at all */
if (! basename_proc) if (! basename_proc)
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG, "basename has no valid extension");
g_print ("%s: basename has no valid extension\n",
G_STRFUNC);
#endif
if (! strchr (basename, '.')) if (! strchr (basename, '.'))
{ {
const gchar *ext = NULL; const gchar *ext = NULL;
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG, "basename has no '.', trying to add extension");
g_print ("%s: basename has no '.', trying to add extension\n",
G_STRFUNC);
#endif
if (! save_proc) if (! save_proc)
{ {
...@@ -246,10 +242,7 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -246,10 +242,7 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
gchar *ext_basename = g_strconcat (basename, ".", ext, NULL); gchar *ext_basename = g_strconcat (basename, ".", ext, NULL);
gchar *utf8; gchar *utf8;
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG, "appending .%s to basename", ext);
g_print ("%s: appending .%s to basename\n",
G_STRFUNC, ext);
#endif
g_free (uri); g_free (uri);
g_free (basename); g_free (basename);
...@@ -267,10 +260,9 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -267,10 +260,9 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
utf8); utf8);
g_free (utf8); g_free (utf8);
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG,
g_print ("%s: set basename to %s, rerunning response and " "set basename to %s, rerunning response and bailing out",
"bailing out\n", G_STRFUNC, basename); basename);
#endif
/* call the response callback again, so the /* call the response callback again, so the
* overwrite-confirm logic can check the changed uri * overwrite-confirm logic can check the changed uri
...@@ -284,10 +276,8 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -284,10 +276,8 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
} }
else else
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG,
g_print ("%s: save_proc has no extensions, continuing without\n", "save_proc has no extensions, continuing without");
G_STRFUNC);
#endif
/* there may be file formats with no extension at all, use /* there may be file formats with no extension at all, use
* the selected proc in this case. * the selected proc in this case.
...@@ -300,10 +290,8 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -300,10 +290,8 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
if (! basename_proc) if (! basename_proc)
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG,
g_print ("%s: unable to figure save_proc, bailing out\n", "unable to figure save_proc, bailing out");
G_STRFUNC);
#endif
gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING, gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING,
_("The given filename does not have any known " _("The given filename does not have any known "
...@@ -317,11 +305,9 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -317,11 +305,9 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
} }
else if (save_proc && ! save_proc->extensions_list) else if (save_proc && ! save_proc->extensions_list)
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG,
g_print ("%s: basename has '.', but save_proc has no extensions, " "basename has '.', but save_proc has no extensions, "
"accepting random extension\n", "accepting random extension");
G_STRFUNC);
#endif
/* accept any random extension if the file format has /* accept any random extension if the file format has
* no extensions at all * no extensions at all
...@@ -336,17 +322,12 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -336,17 +322,12 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
/* then check if the selected format matches the entered extension */ /* then check if the selected format matches the entered extension */
if (! save_proc) if (! save_proc)
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG, "no save_proc was selected from the list");
g_print ("%s: no save_proc was selected from the list\n",
G_STRFUNC);
#endif
if (! basename_proc) if (! basename_proc)
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG,
g_print ("%s: basename had no useful extension, bailing out\n", "basename has no useful extension, bailing out");
G_STRFUNC);
#endif
gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING, gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING,
_("The given filename does not have any known " _("The given filename does not have any known "
...@@ -358,35 +339,26 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -358,35 +339,26 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
return FALSE; return FALSE;
} }
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG, "use URI's proc '%s' so indirect saving works",
g_print ("%s: use URI's proc '%s' so indirect saving works\n", uri_proc->menu_label ? uri_proc->menu_label : "<unnamed>");
G_STRFUNC, uri_proc->menu_label ? uri_proc->menu_label : "?");
#endif
/* use the URI's proc if no save proc was selected */ /* use the URI's proc if no save proc was selected */
save_proc = uri_proc; save_proc = uri_proc;
} }
else else
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG, "save_proc '%s' was selected from the list",
g_print ("%s: save_proc '%s' was selected from the list\n", save_proc->menu_label ? save_proc->menu_label : "<unnamed>");
G_STRFUNC, save_proc->menu_label);
#endif
if (save_proc != basename_proc) if (save_proc != basename_proc)
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG, "however the basename's proc is '%s'",
g_print ("%s: however the basename's proc is '%s'\n", basename_proc ? basename_proc->menu_label : "NULL");
G_STRFUNC,
basename_proc ? basename_proc->menu_label : "NULL");
#endif
if (uri_proc != basename_proc) if (uri_proc != basename_proc)
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG,
g_print ("%s: that's impossible for remote URIs, bailing out\n", "that's impossible for remote URIs, bailing out");
G_STRFUNC);
#endif
/* remote URI */ /* remote URI */
...@@ -402,10 +374,8 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -402,10 +374,8 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
} }
else else
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG,
g_print ("%s: ask the user if she really wants that filename\n", "ask the user if she really wants that filename");
G_STRFUNC);
#endif
/* local URI */ /* local URI */
...@@ -419,10 +389,9 @@ file_save_dialog_check_uri (GtkWidget *save_dialog, ...@@ -419,10 +389,9 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
} }
else if (save_proc != uri_proc) else if (save_proc != uri_proc)
{ {
#ifdef DEBUG_SPEW GIMP_LOG (SAVE_DIALOG,
g_print ("%s: use URI's proc '%s' so indirect saving works\n", "use URI's proc '%s' so indirect saving works",
G_STRFUNC, uri_proc->menu_label); uri_proc->menu_label ? uri_proc->menu_label : "<unnamed>");
#endif
/* need to use the URI's proc for saving because e.g. /* need to use the URI's proc for saving because e.g.
* the GIF plug-in can't save a GIF to sftp:// * the GIF plug-in can't save a GIF to sftp://
......
...@@ -38,7 +38,8 @@ gimp_log_init (void) ...@@ -38,7 +38,8 @@ gimp_log_init (void)
{ "tools", GIMP_LOG_TOOLS }, { "tools", GIMP_LOG_TOOLS },
{ "dnd", GIMP_LOG_DND }, { "dnd", GIMP_LOG_DND },
{ "help", GIMP_LOG_HELP }, { "help", GIMP_LOG_HELP },
{ "dialog-factory", GIMP_LOG_DIALOG_FACTORY } { "dialog-factory", GIMP_LOG_DIALOG_FACTORY },
{ "save-dialog", GIMP_LOG_SAVE_DIALOG }
}; };
gimp_log_flags = g_parse_debug_string (env_log_val, gimp_log_flags = g_parse_debug_string (env_log_val,
......
...@@ -25,7 +25,8 @@ typedef enum ...@@ -25,7 +25,8 @@ typedef enum
GIMP_LOG_TOOLS = 1 << 0, GIMP_LOG_TOOLS = 1 << 0,
GIMP_LOG_DND = 1 << 1, GIMP_LOG_DND = 1 << 1,
GIMP_LOG_HELP = 1 << 2, GIMP_LOG_HELP = 1 << 2,
GIMP_LOG_DIALOG_FACTORY = 1 << 3 GIMP_LOG_DIALOG_FACTORY = 1 << 3,
GIMP_LOG_SAVE_DIALOG = 1 << 4
} GimpLogFlags; } GimpLogFlags;
......
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