diff pidgin/gtkdebug.c @ 15985:6dc5dc83a61b

Add a whimpy ui op to the debug API that returns TRUE if debugging is turned on in the UI. This allows the core to avoid having a call to g_strdup_vprintf() for each debug message when debugging is turned off. The change should provide a very very small speed improvement, since we tend to print a lot of debug output.
author Mark Doliner <mark@kingant.net>
date Tue, 03 Apr 2007 06:26:20 +0000
parents 66dff3dfdea6
children 0315b014741b
line wrap: on
line diff
--- a/pidgin/gtkdebug.c	Mon Apr 02 00:38:21 2007 +0000
+++ b/pidgin/gtkdebug.c	Tue Apr 03 06:26:20 2007 +0000
@@ -1104,9 +1104,17 @@
 	g_free(s);
 }
 
+static gboolean
+pidgin_debug_is_enabled(PurpleDebugLevel level, const char *category)
+{
+	return (purple_prefs_get_bool("/purple/gtk/debug/enabled") &&
+			debug_win != NULL);
+}
+
 static PurpleDebugUiOps ops =
 {
 	pidgin_debug_print,
+	pidgin_debug_is_enabled
 };
 
 PurpleDebugUiOps *