summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2010-09-08 18:17:57 +0300
committerTor Lillqvist <tml@iki.fi>2010-09-08 21:31:34 +0300
commit801875b8050e7113249943000276f72ffec07e6e (patch)
tree983ae4ab53c128289a265564f5edfc85bd8f06fa
parent2ab562a6f76989823b48a07e52d903727944019e (diff)
downloadgtk+-801875b8050e7113249943000276f72ffec07e6e.tar.gz
Replace gtk_debug_flags with getter and setter functions
Preferrably should be made just into a local variable for libgtk like _gdk_debug_flags for libgdk. But for now used by gtk/tests/textbuffer.c and modules/printbackends/cups/gtkprintbackendcups.c.
-rw-r--r--gtk/gtk.symbols3
-rw-r--r--gtk/gtkbuilder.c2
-rw-r--r--gtk/gtkbuilderparser.c2
-rw-r--r--gtk/gtkdebug.h15
-rw-r--r--gtk/gtkiconcache.c2
-rw-r--r--gtk/gtkmain.c44
-rw-r--r--gtk/gtkprintjob.c2
-rw-r--r--gtk/gtkrbtree.c22
-rw-r--r--gtk/gtktextbtree.c26
-rw-r--r--gtk/gtktextiter.c2
-rw-r--r--gtk/gtktextsegment.c14
-rw-r--r--gtk/gtktextview.c2
-rw-r--r--gtk/gtktreestore.c2
-rw-r--r--gtk/gtkwidget.c2
-rw-r--r--gtk/tests/textbuffer.c2
-rw-r--r--modules/printbackends/cups/gtkprintbackendcups.c2
16 files changed, 79 insertions, 65 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 64792c91bd..d761f30d27 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -1849,6 +1849,8 @@ gtk_list_store_swap
#if IN_HEADER(__GTK_MAIN_H__)
#if IN_FILE(__GTK_MAIN_C__)
+gtk_get_debug_flags
+gtk_set_debug_flags
gtk_get_option_group
gtk_get_current_event
gtk_get_current_event_device
@@ -4540,7 +4542,6 @@ gtk_info_bar_get_message_type
#endif
#ifdef INCLUDE_VARIABLES
-gtk_debug_flags
gtk_text_attr_appearance_type
gtk_text_char_type
gtk_text_child_type
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index eb4db8abb9..127bae2bc9 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -701,7 +701,7 @@ _gtk_builder_construct (GtkBuilder *builder,
g_object_set_property (obj, param->name, &param->value);
#if G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_BUILDER)
+ if (gtk_get_debug_flags () & GTK_DEBUG_BUILDER)
{
gchar *str = g_strdup_value_contents ((const GValue*)&param->value);
g_print ("set %s: %s = %s\n", info->id, param->name, str);
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index a3954d1ae5..11fe3c63f1 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -835,7 +835,7 @@ start_element (GMarkupParseContext *context,
ParserData *data = (ParserData*)user_data;
#ifdef GTK_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_BUILDER)
+ if (gtk_get_debug_flags () & GTK_DEBUG_BUILDER)
{
GString *tags = g_string_new ("");
int i;
diff --git a/gtk/gtkdebug.h b/gtk/gtkdebug.h
index a755ca60fd..b9fb21803f 100644
--- a/gtk/gtkdebug.h
+++ b/gtk/gtkdebug.h
@@ -54,7 +54,7 @@ typedef enum {
#ifdef G_ENABLE_DEBUG
#define GTK_NOTE(type,action) G_STMT_START { \
- if (gtk_debug_flags & GTK_DEBUG_##type) \
+ if (gtk_get_debug_flags () & GTK_DEBUG_##type) \
{ action; }; } G_STMT_END
#else /* !G_ENABLE_DEBUG */
@@ -63,17 +63,8 @@ typedef enum {
#endif /* G_ENABLE_DEBUG */
-#ifdef G_OS_WIN32
-# ifdef GTK_COMPILATION
-# define GTKVAR __declspec(dllexport)
-# else
-# define GTKVAR extern __declspec(dllimport)
-# endif
-#else
-# define GTKVAR extern
-#endif
-
-GTKVAR guint gtk_debug_flags;
+guint gtk_get_debug_flags (void);
+void gtk_set_debug_flags (guint flags);
G_END_DECLS
diff --git a/gtk/gtkiconcache.c b/gtk/gtkiconcache.c
index 73d063aee3..ecaf6df1ea 100644
--- a/gtk/gtkiconcache.c
+++ b/gtk/gtkiconcache.c
@@ -130,7 +130,7 @@ _gtk_icon_cache_new_for_path (const gchar *path)
info.flags = CHECK_OFFSETS|CHECK_STRINGS;
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_ICONTHEME)
+ if (gtk_get_debug_flags () & GTK_DEBUG_ICONTHEME)
{
if (!_gtk_icon_cache_validate (&info))
{
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 89c2c30301..6f3c5ea649 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -192,7 +192,7 @@ static GList *quit_functions = NULL; /* A list of quit functions.
*/
static GSList *key_snoopers = NULL;
-guint gtk_debug_flags = 0; /* Global GTK debug flag */
+static guint debug_flags = 0; /* Global GTK debug flag */
#ifdef G_ENABLE_DEBUG
static const GDebugKey gtk_debug_keys[] = {
@@ -477,9 +477,9 @@ static gboolean g_fatal_warnings = FALSE;
static gboolean
gtk_arg_debug_cb (const char *key, const char *value, gpointer user_data)
{
- gtk_debug_flags |= g_parse_debug_string (value,
- gtk_debug_keys,
- G_N_ELEMENTS (gtk_debug_keys));
+ debug_flags |= g_parse_debug_string (value,
+ gtk_debug_keys,
+ G_N_ELEMENTS (gtk_debug_keys));
return TRUE;
}
@@ -487,9 +487,9 @@ gtk_arg_debug_cb (const char *key, const char *value, gpointer user_data)
static gboolean
gtk_arg_no_debug_cb (const char *key, const char *value, gpointer user_data)
{
- gtk_debug_flags &= ~g_parse_debug_string (value,
- gtk_debug_keys,
- G_N_ELEMENTS (gtk_debug_keys));
+ debug_flags &= ~g_parse_debug_string (value,
+ gtk_debug_keys,
+ G_N_ELEMENTS (gtk_debug_keys));
return TRUE;
}
@@ -727,9 +727,9 @@ do_pre_parse_initialization (int *argc,
env_string = g_getenv ("GTK_DEBUG");
if (env_string != NULL)
{
- gtk_debug_flags = g_parse_debug_string (env_string,
- gtk_debug_keys,
- G_N_ELEMENTS (gtk_debug_keys));
+ debug_flags = g_parse_debug_string (env_string,
+ gtk_debug_keys,
+ G_N_ELEMENTS (gtk_debug_keys));
env_string = NULL;
}
#endif /* G_ENABLE_DEBUG */
@@ -776,7 +776,7 @@ do_post_parse_initialization (int *argc,
g_log_set_always_fatal (fatal_mask);
}
- if (gtk_debug_flags & GTK_DEBUG_UPDATES)
+ if (debug_flags & GTK_DEBUG_UPDATES)
gdk_window_set_debug_updates (TRUE);
{
@@ -862,6 +862,28 @@ post_parse_hook (GOptionContext *context,
/**
+ * gtk_get_debug_flags:
+ *
+ * Returns the GTK+ debug flags setting.
+ */
+guint
+gtk_get_debug_flags (void)
+{
+ return debug_flags;
+}
+
+/**
+ * gtk_set_debug_flags:
+ *
+ * Sets the GTK+ debug flags.
+ */
+void
+gtk_set_debug_flags (guint flags)
+{
+ debug_flags = flags;
+}
+
+/**
* gtk_get_option_group:
* @open_default_display: whether to open the default display
* when parsing the commandline arguments
diff --git a/gtk/gtkprintjob.c b/gtk/gtkprintjob.c
index e30deb00c6..7dc890b0b4 100644
--- a/gtk/gtkprintjob.c
+++ b/gtk/gtkprintjob.c
@@ -485,7 +485,7 @@ gtk_print_job_get_surface (GtkPrintJob *job,
#ifdef G_ENABLE_DEBUG
/* If we are debugging printing don't delete the tmp files */
- if (!(gtk_debug_flags & GTK_DEBUG_PRINTING))
+ if (!(gtk_get_debug_flags () & GTK_DEBUG_PRINTING))
#endif /* G_ENABLE_DEBUG */
g_unlink (filename);
g_free (filename);
diff --git a/gtk/gtkrbtree.c b/gtk/gtkrbtree.c
index fdd45ad812..b351eb7fc3 100644
--- a/gtk/gtkrbtree.c
+++ b/gtk/gtkrbtree.c
@@ -59,7 +59,7 @@ _gtk_rbnode_new (GtkRBTree *tree,
static void
_gtk_rbnode_free (GtkRBNode *node)
{
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
node->left = (gpointer) 0xdeadbeef;
node->right = (gpointer) 0xdeadbeef;
@@ -384,7 +384,7 @@ _gtk_rbtree_remove (GtkRBTree *tree)
gint height = tree->root->offset;
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
_gtk_rbtree_test (G_STRLOC, tree);
#endif
@@ -417,7 +417,7 @@ _gtk_rbtree_remove (GtkRBTree *tree)
_gtk_rbtree_free (tree);
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
_gtk_rbtree_test (G_STRLOC, tmp_tree);
#endif
}
@@ -435,7 +435,7 @@ _gtk_rbtree_insert_after (GtkRBTree *tree,
GtkRBTree *tmp_tree;
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
g_print ("\n\n_gtk_rbtree_insert_after: %p\n", current);
_gtk_rbtree_debug_spew (tree);
@@ -496,7 +496,7 @@ _gtk_rbtree_insert_after (GtkRBTree *tree,
_gtk_rbtree_insert_fixup (tree, node);
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
g_print ("_gtk_rbtree_insert_after finished...\n");
_gtk_rbtree_debug_spew (tree);
@@ -520,7 +520,7 @@ _gtk_rbtree_insert_before (GtkRBTree *tree,
GtkRBTree *tmp_tree;
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
g_print ("\n\n_gtk_rbtree_insert_before: %p\n", current);
_gtk_rbtree_debug_spew (tree);
@@ -582,7 +582,7 @@ _gtk_rbtree_insert_before (GtkRBTree *tree,
_gtk_rbtree_insert_fixup (tree, node);
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
g_print ("_gtk_rbtree_insert_before finished...\n");
_gtk_rbtree_debug_spew (tree);
@@ -639,7 +639,7 @@ _gtk_rbtree_node_set_height (GtkRBTree *tree,
}
}
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
_gtk_rbtree_test (G_STRLOC, tree);
#endif
}
@@ -1119,7 +1119,7 @@ _gtk_rbtree_remove_node (GtkRBTree *tree,
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
g_print ("\n\n_gtk_rbtree_remove_node: %p\n", node);
_gtk_rbtree_debug_spew (tree);
@@ -1133,7 +1133,7 @@ _gtk_rbtree_remove_node (GtkRBTree *tree,
g_return_if_fail (x == tree->root);
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
_gtk_rbtree_test (G_STRLOC, tree);
#endif
@@ -1262,7 +1262,7 @@ _gtk_rbtree_remove_node (GtkRBTree *tree,
_gtk_rbnode_free (y);
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
g_print ("_gtk_rbtree_remove_node finished...\n");
_gtk_rbtree_debug_spew (tree);
diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c
index 0e999e4bc6..72abfc5d1f 100644
--- a/gtk/gtktextbtree.c
+++ b/gtk/gtktextbtree.c
@@ -753,7 +753,7 @@ _gtk_text_btree_delete (GtkTextIter *start,
tree = _gtk_text_iter_get_btree (start);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
/* Broadcast the need for redisplay before we break the iterators */
@@ -1075,7 +1075,7 @@ _gtk_text_btree_delete (GtkTextIter *start,
chars_changed (tree);
segments_changed (tree);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
/* Re-initialize our iterators */
@@ -1357,7 +1357,7 @@ find_line_by_y (GtkTextBTree *tree, BTreeView *view,
{
gint current_y = 0;
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
if (node->level == 0)
@@ -2009,7 +2009,7 @@ _gtk_text_btree_tag (const GtkTextIter *start_orig,
queue_tag_redisplay (tree, tag, &start, &end);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
}
@@ -2734,7 +2734,7 @@ real_set_mark (GtkTextBTree *tree,
iter = *where;
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_iter_check (&iter);
if (mark != NULL)
@@ -2791,7 +2791,7 @@ real_set_mark (GtkTextBTree *tree,
mark);
}
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_iter_check (&iter);
/* Link mark into new location */
@@ -2806,10 +2806,10 @@ real_set_mark (GtkTextBTree *tree,
redisplay_mark_if_visible (mark);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_iter_check (&iter);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
return mark;
@@ -4327,7 +4327,7 @@ _gtk_text_line_next_could_contain_tag (GtkTextLine *line,
g_return_val_if_fail (line != NULL, NULL);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
if (tag == NULL)
@@ -4490,7 +4490,7 @@ _gtk_text_line_previous_could_contain_tag (GtkTextLine *line,
g_return_val_if_fail (line != NULL, NULL);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
if (tag == NULL)
@@ -5262,7 +5262,7 @@ _gtk_text_btree_validate (GtkTextBTree *tree,
if (new_height)
*new_height = state.new_height;
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
return TRUE;
@@ -5971,7 +5971,7 @@ post_insert_fixup (GtkTextBTree *tree,
gtk_text_btree_rebalance (tree, node);
}
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
}
@@ -6537,7 +6537,7 @@ gtk_text_btree_link_segment (GtkTextLineSegment *seg,
cleanup_line (line);
segments_changed (tree);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_btree_check (tree);
}
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c
index 9daecfc6b6..b8f66447df 100644
--- a/gtk/gtktextiter.c
+++ b/gtk/gtktextiter.c
@@ -370,7 +370,7 @@ is_segment_start (GtkTextRealIter *real)
static void
check_invariants (const GtkTextIter *iter)
{
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_iter_check (iter);
}
#else
diff --git a/gtk/gtktextsegment.c b/gtk/gtktextsegment.c
index dfd7c7e441..d1493d69a4 100644
--- a/gtk/gtktextsegment.c
+++ b/gtk/gtktextsegment.c
@@ -103,7 +103,7 @@ gtk_text_line_segment_split (const GtkTextIter *iter)
count = gtk_text_iter_get_line_index (iter);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
_gtk_text_iter_check (iter);
prev = NULL;
@@ -203,7 +203,7 @@ _gtk_char_segment_new (const gchar *text, guint len)
seg->char_count = g_utf8_strlen (seg->body.chars, seg->byte_count);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
char_segment_self_check (seg);
return seg;
@@ -232,7 +232,7 @@ _gtk_char_segment_new_from_two_strings (const gchar *text1,
seg->char_count = chars1 + chars2;
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
char_segment_self_check (seg);
return seg;
@@ -263,7 +263,7 @@ char_segment_split_func (GtkTextLineSegment *seg, int index)
g_assert (index < seg->byte_count);
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
{
char_segment_self_check (seg);
}
@@ -279,7 +279,7 @@ char_segment_split_func (GtkTextLineSegment *seg, int index)
new1->next = new2;
new2->next = seg->next;
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
{
char_segment_self_check (new1);
char_segment_self_check (new2);
@@ -318,7 +318,7 @@ char_segment_cleanup_func (GtkTextLineSegment *segPtr, GtkTextLine *line)
{
GtkTextLineSegment *segPtr2, *newPtr;
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
char_segment_self_check (segPtr);
segPtr2 = segPtr->next;
@@ -337,7 +337,7 @@ char_segment_cleanup_func (GtkTextLineSegment *segPtr, GtkTextLine *line)
newPtr->next = segPtr2->next;
- if (gtk_debug_flags & GTK_DEBUG_TEXT)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TEXT)
char_segment_self_check (newPtr);
g_free (segPtr);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index e79dec917a..a00c933e2a 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -5011,7 +5011,7 @@ cursor_blinks (GtkTextView *text_view)
#ifdef DEBUG_VALIDATION_AND_SCROLLING
return FALSE;
#endif
- if (gtk_debug_flags & GTK_DEBUG_UPDATES)
+ if (gtk_get_debug_flags () & GTK_DEBUG_UPDATES)
return FALSE;
g_object_get (settings, "gtk-cursor-blink", &blink, NULL);
diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c
index 7047dfb861..eb5a0cc8ba 100644
--- a/gtk/gtktreestore.c
+++ b/gtk/gtktreestore.c
@@ -143,7 +143,7 @@ static void gtk_tree_store_move (GtkTreeStore *
static inline void
validate_tree (GtkTreeStore *tree_store)
{
- if (gtk_debug_flags & GTK_DEBUG_TREE)
+ if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
g_assert (G_NODE (tree_store->root)->parent == NULL);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 628dc9207f..e3c5bb5d48 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3896,7 +3896,7 @@ gtk_widget_size_allocate (GtkWidget *widget,
g_return_if_fail (GTK_IS_WIDGET (widget));
#ifdef G_ENABLE_DEBUG
- if (gtk_debug_flags & GTK_DEBUG_GEOMETRY)
+ if (gtk_get_debug_flags () & GTK_DEBUG_GEOMETRY)
{
gint depth;
GtkWidget *parent;
diff --git a/gtk/tests/textbuffer.c b/gtk/tests/textbuffer.c
index 010776d478..d104358943 100644
--- a/gtk/tests/textbuffer.c
+++ b/gtk/tests/textbuffer.c
@@ -1326,7 +1326,7 @@ int
main (int argc, char** argv)
{
/* First, we turn on btree debugging. */
- gtk_debug_flags |= GTK_DEBUG_TEXT;
+ gtk_set_debug_flags (gtk_get_debug_flags () | GTK_DEBUG_TEXT);
gtk_test_init (&argc, &argv);
pixbuf_init ();
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index d23ed70895..c2308591b6 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -2342,7 +2342,7 @@ cups_request_ppd (GtkPrinter *printer)
#ifdef G_ENABLE_DEBUG
/* If we are debugging printing don't delete the tmp files */
- if (!(gtk_debug_flags & GTK_DEBUG_PRINTING))
+ if (!(gtk_get_debug_flags () & GTK_DEBUG_PRINTING))
unlink (ppd_filename);
#else
unlink (ppd_filename);