diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-02-28 15:33:18 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-02-28 21:40:23 -0500 |
commit | 2ee7fb1818598de6372dae48b89f5e6925e1d77b (patch) | |
tree | 670f3ea63ec1ee2b7ac8a340522ff983f946b2e7 /gtk/gtksizerequest.c | |
parent | 0ac71e81cf9e80fc3b7903e98e0c3cb059cb68ca (diff) | |
download | gtk+-2ee7fb1818598de6372dae48b89f5e6925e1d77b.tar.gz |
Don't use g_print for debug output
The g_print documentation explicitly says not to do this, since
g_print is meant to be redirected by applications. Instead use
g_message for logging that can be triggered via GTK_DEBUG.
Diffstat (limited to 'gtk/gtksizerequest.c')
-rw-r--r-- | gtk/gtksizerequest.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index 61e0ba331a..ed60b43e63 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -340,18 +340,24 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget, g_assert (min_size <= nat_size); - GTK_NOTE (SIZE_REQUEST, - g_print ("[%p] %s\t%s: %d is minimum %d and natural: %d", - widget, G_OBJECT_TYPE_NAME (widget), - orientation == GTK_ORIENTATION_HORIZONTAL ? - "width for height" : "height for width" , - for_size, min_size, nat_size); + GTK_NOTE (SIZE_REQUEST, { + GString *s; + + s = g_string_new (""); + g_string_append_printf (s, "[%p] %s\t%s: %d is minimum %d and natural: %d", + widget, G_OBJECT_TYPE_NAME (widget), + orientation == GTK_ORIENTATION_HORIZONTAL + ? "width for height" + : "height for width", + for_size, min_size, nat_size); if (min_baseline != -1 || nat_baseline != -1) - g_print (", baseline %d/%d", - min_baseline, nat_baseline); - g_print (" (hit cache: %s)\n", - found_in_cache ? "yes" : "no") - ); + g_string_append_printf (s, ", baseline %d/%d", + min_baseline, nat_baseline); + g_string_append_printf (s, " (hit cache: %s)\n", + found_in_cache ? "yes" : "no"); + g_message ("%s", s->str); + g_string_free (s, TRUE); + }); } /* This is the main function that checks for a cached size and |