Revision fa201fe30f55d6bb7c3968fde6784153a44c13be

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Apr 3 02:30:35 EDT 2007


o   -----------------------------------------------------------------
|   Revision: fa201fe30f55d6bb7c3968fde6784153a44c13be
|   Ancestor: e592576086a8eb6017c5e1ba12141d31a1ece575
|   Author: markdoliner at pidgin.im
|   Date: 2007-04-03T06:26:20
|   Branch: im.pidgin.pidgin
|   
|   Modified files:
|           finch/gntdebug.c libpurple/debug.c libpurple/debug.h
|           pidgin/gtkdebug.c
|   
|   ChangeLog: 
|   
|   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.
|   
|   ============================================================
|   --- finch/gntdebug.c	4bc6f0ba9624589a087586b26ec5aae164313f29
|   +++ finch/gntdebug.c	7bacf29457fce603a1923ab441b0351c8e52c58c
|   @@ -106,9 +106,16 @@ finch_debug_print(PurpleDebugLevel level
|    	}
|    }
|    
|   +static gboolean
|   +finch_debug_is_enabled(PurpleDebugLevel level, const char *category)
|   +{
|   +	return debug.window && !debug.paused;
|   +}
|   +
|    static PurpleDebugUiOps uiops =
|    {
|    	finch_debug_print,
|   +	finch_debug_is_enabled
|    };
|    
|    PurpleDebugUiOps *finch_debug_get_ui_ops()
|   ============================================================
|   --- libpurple/debug.c	745300c76e6379ea95e2aaecf10c46ff5450bfab
|   +++ libpurple/debug.c	5ed8c00d8287bcff93ec5998f561d1867950e53a
|   @@ -53,7 +53,8 @@ purple_debug_vargs(PurpleDebugLevel leve
|    
|    	ops = purple_debug_get_ui_ops();
|    
|   -	if (!debug_enabled && ((ops == NULL) || (ops->print == NULL)))
|   +	if (!debug_enabled && ((ops == NULL) || (ops->print == NULL) ||
|   +			(ops->is_enabled && !ops->is_enabled(level, category))))
|    		return;
|    
|    	arg_s = g_strdup_vprintf(format, args);
|   ============================================================
|   --- libpurple/debug.h	c01ce3088152c93f0b4ae3f44f71e4e5b910d6d0
|   +++ libpurple/debug.h	34e893acfcf84ace3f8e548e912918862b80b907
|   @@ -49,6 +49,8 @@ typedef struct
|    {
|    	void (*print)(PurpleDebugLevel level, const char *category,
|    				  const char *arg_s);
|   +	gboolean (*is_enabled)(PurpleDebugLevel level,
|   +			const char *category);
|    } PurpleDebugUiOps;
|    
|    #ifdef __cplusplus
|   ============================================================
|   --- pidgin/gtkdebug.c	32b11f4028502fc9383ccc841a6897fa2fd464d7
|   +++ pidgin/gtkdebug.c	950e991a266244378cc8efc2147236f4e0019529
|   @@ -1104,9 +1104,17 @@ pidgin_debug_print(PurpleDebugLevel leve
|    	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 *

To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from fa201fe30f55d6bb7c3968fde6784153a44c13be


More information about the Commits mailing list