# HG changeset patch # User Stu Tomlinson # Date 1178760800 0 # Node ID 8d94cf6880091c1b32409525f82948d28b1c8c12 # Parent b4720d213f316348f3552a33277a24d999f7a25a Force timestamps always on for debug log and debug window. Making this optional seems pointless and can significantly reduce the usefulness of debug logs for things where timestamps would be useful but the user turned them off. diff -r b4720d213f31 -r 8d94cf688009 libpurple/debug.c --- a/libpurple/debug.c Wed May 09 23:44:49 2007 +0000 +++ b/libpurple/debug.c Thu May 10 01:33:20 2007 +0000 @@ -61,18 +61,12 @@ if (debug_enabled) { gchar *ts_s; - - if ((category != NULL) && - (purple_prefs_exists("/purple/debug/timestamps")) && - (purple_prefs_get_bool("/purple/debug/timestamps"))) { - const char *mdate; + const char *mdate; + time_t mtime = time(NULL); - time_t mtime = time(NULL); - mdate = purple_utf8_strftime("%H:%M:%S", localtime(&mtime)); - ts_s = g_strdup_printf("(%s) ", mdate); - } else { - ts_s = g_strdup(""); - } + + mdate = purple_utf8_strftime("%H:%M:%S", localtime(&mtime)); + ts_s = g_strdup_printf("(%s) ", mdate); if (category == NULL) g_print("%s%s", ts_s, arg_s); @@ -189,11 +183,4 @@ void purple_debug_init(void) { - purple_prefs_add_none("/purple/debug"); - - /* - * This pref is currently used by both the console - * output and the debug window output. - */ - purple_prefs_add_bool("/purple/debug/timestamps", FALSE); } diff -r b4720d213f31 -r 8d94cf688009 libpurple/prefs.c --- a/libpurple/prefs.c Wed May 09 23:44:49 2007 +0000 +++ b/libpurple/prefs.c Thu May 10 01:33:20 2007 +0000 @@ -1355,6 +1355,7 @@ purple_prefs_remove("/plugins/core/autorecon/hide_reconnecting_dialog"); purple_prefs_remove("/plugins/core/autorecon/restore_state"); purple_prefs_remove("/plugins/core/autorecon"); + purple_prefs_remove("/purple/debug/timestamps"); /* Convert old sounds while_away pref to new 3-way pref. */ if (purple_prefs_exists("/purple/sound/while_away") && diff -r b4720d213f31 -r 8d94cf688009 pidgin/gtkdebug.c --- a/pidgin/gtkdebug.c Wed May 09 23:44:49 2007 +0000 +++ b/pidgin/gtkdebug.c Thu May 10 01:33:20 2007 +0000 @@ -49,7 +49,6 @@ GtkListStore *store; - gboolean timestamps; gboolean paused; #ifdef HAVE_REGEX_H @@ -261,21 +260,6 @@ #endif /* HAVE_REGEX_H */ } -static void -timestamps_cb(GtkWidget *w, DebugWindow *win) -{ - win->timestamps = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); - - purple_prefs_set_bool("/purple/debug/timestamps", win->timestamps); -} - -static void -timestamps_pref_cb(const char *name, PurplePrefType type, - gconstpointer value, gpointer data) -{ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data), GPOINTER_TO_INT(value)); -} - /****************************************************************************** * regex stuff *****************************************************************************/ @@ -691,7 +675,6 @@ GtkWidget *vbox; GtkWidget *toolbar; GtkWidget *frame; - GtkWidget *button; GtkWidget *image; gint width, height; void *handle; @@ -779,20 +762,6 @@ NULL, image, G_CALLBACK(pause_cb), win); - /* Timestamps */ - button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), - GTK_TOOLBAR_CHILD_TOGGLEBUTTON, - NULL, _("Timestamps"), - _("Timestamps"), NULL, NULL, - G_CALLBACK(timestamps_cb), - win); - - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), - purple_prefs_get_bool("/purple/debug/timestamps")); - - purple_prefs_connect_callback(handle, "/purple/debug/timestamps", - timestamps_pref_cb, button); - #ifdef HAVE_REGEX_H /* regex stuff */ gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1); @@ -1044,9 +1013,10 @@ #ifdef HAVE_REGEX_H GtkTreeIter iter; #endif /* HAVE_REGEX_H */ - gboolean timestamps; gchar *ts_s; gchar *esc_s, *cat_s, *tmp, *s; + const char *mdate; + time_t mtime; if (debug_win == NULL || !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")) @@ -1054,22 +1024,9 @@ return; } - timestamps = purple_prefs_get_bool("/purple/debug/timestamps"); - - /* - * For some reason we only print the timestamp if category is - * not NULL. Why the hell do we do that? --Mark - */ - if ((category != NULL) && (timestamps)) { - const char *mdate; - - time_t mtime = time(NULL); - mdate = purple_utf8_strftime("%H:%M:%S", localtime(&mtime)); - ts_s = g_strdup_printf("(%s) ", mdate); - } else { - ts_s = g_strdup(""); - } - + mtime = time(NULL); + mdate = purple_utf8_strftime("%H:%M:%S", localtime(&mtime)); + ts_s = g_strdup_printf("(%s) ", mdate); if (category == NULL) cat_s = g_strdup(""); else