Tue, 15 Oct 2024 00:47:42 -0500
Port prefs to AdwSwitchRow
Now that we depend on Adwaita 1.4, we can flip the switch on using these (pun intended).
This also simplifies some extra tracking we needed to do for activations and focus, since the Adwaita widgets do that for us.
Testing Done:
Opened prefs, confirmed all the switches were there, and toggled them all without any warnings.
Also used the mnemonics to toggle the switches from the keyboard.
Reviewed at https://reviews.imfreedom.org/r/3582/
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
1 | /* |
|
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
| 5212 | 4 | * |
| 15884 | 5 | * Purple is the legal property of its developers, whose names are too numerous |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 8046 | 7 | * source distribution. |
|
6483
d12ecdf8e489
[gaim-migrate @ 6997]
Christian Hammond <chipx86@chipx86.com>
parents:
5212
diff
changeset
|
8 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
12 | * any later version. |
| 5212 | 13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
17 | * more details. |
| 5212 | 18 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
41840
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
| 5212 | 21 | */ |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
22 | |
| 5212 | 23 | #include "debug.h" |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
24 | #include "prefs.h" |
| 5212 | 25 | |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
26 | /* |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
27 | * These determine whether verbose or unsafe debugging are desired. I |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
28 | * don't want to make these purple preferences because their values should |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
29 | * not be remembered across instances of the UI. |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
30 | */ |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
31 | static gboolean debug_verbose = FALSE; |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
32 | static gboolean debug_unsafe = FALSE; |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
33 | |
|
11504
eabc708c2ea9
[gaim-migrate @ 13749]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
34 | static void |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
35 | purple_debug_vargs(PurpleDebugLevel level, const gchar *category, |
|
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
36 | const gchar *format, va_list args) |
| 5212 | 37 | { |
|
41119
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
38 | GLogLevelFlags log_level = G_LOG_LEVEL_DEBUG; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
39 | gchar *msg = NULL; |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
40 | |
| 5212 | 41 | g_return_if_fail(format != NULL); |
| 42 | ||
|
41119
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
43 | /* GLib's debug levels are not quite the same as ours, so we need to |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
44 | * re-assign them. */ |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
45 | switch(level) { |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
46 | case PURPLE_DEBUG_MISC: |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
47 | log_level = G_LOG_LEVEL_INFO; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
48 | break; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
49 | case PURPLE_DEBUG_INFO: |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
50 | log_level = G_LOG_LEVEL_MESSAGE; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
51 | break; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
52 | case PURPLE_DEBUG_WARNING: |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
53 | log_level = G_LOG_LEVEL_WARNING; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
54 | break; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
55 | case PURPLE_DEBUG_ERROR: |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
56 | log_level = G_LOG_LEVEL_CRITICAL; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
57 | break; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
58 | case PURPLE_DEBUG_FATAL: |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
59 | log_level = G_LOG_LEVEL_ERROR; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
60 | break; |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
61 | default: |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
62 | g_return_if_reached(); |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
63 | } |
|
13988
a178d3dcbb7f
[gaim-migrate @ 16445]
Mark Doliner <markdoliner@pidgin.im>
parents:
13105
diff
changeset
|
64 | |
|
41119
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
65 | /* strip trailing linefeeds */ |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
66 | msg = g_strdup(format); |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
67 | g_strchomp(msg); |
|
34296
d31a4f3b547e
Debug log: optional colored output and no need for add linefeed at the end of each message
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
68 | |
|
41119
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
69 | g_logv(category, log_level, msg, args); |
|
409319dde54e
Send Purple debug messages to GLib structured logging
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41082
diff
changeset
|
70 | g_free(msg); |
| 5212 | 71 | } |
| 72 | ||
| 73 | void | |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
74 | purple_debug(PurpleDebugLevel level, const gchar *category, |
|
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
75 | const gchar *format, ...) |
| 5212 | 76 | { |
| 77 | va_list args; | |
| 78 | ||
| 15884 | 79 | g_return_if_fail(level != PURPLE_DEBUG_ALL); |
| 5212 | 80 | g_return_if_fail(format != NULL); |
| 81 | ||
| 82 | va_start(args, format); | |
| 15884 | 83 | purple_debug_vargs(level, category, format, args); |
| 5212 | 84 | va_end(args); |
| 85 | } | |
| 86 | ||
| 87 | void | |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
88 | purple_debug_misc(const gchar *category, const gchar *format, ...) { |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
89 | va_list args; |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
90 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
91 | g_return_if_fail(format != NULL); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
92 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
93 | va_start(args, format); |
| 15884 | 94 | purple_debug_vargs(PURPLE_DEBUG_MISC, category, format, args); |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
95 | va_end(args); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
96 | } |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
97 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
98 | void |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
99 | purple_debug_info(const gchar *category, const gchar *format, ...) { |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
100 | va_list args; |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
101 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
102 | g_return_if_fail(format != NULL); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
103 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
104 | va_start(args, format); |
| 15884 | 105 | purple_debug_vargs(PURPLE_DEBUG_INFO, category, format, args); |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
106 | va_end(args); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
107 | } |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
108 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
109 | void |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
110 | purple_debug_warning(const gchar *category, const gchar *format, ...) { |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
111 | va_list args; |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
112 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
113 | g_return_if_fail(format != NULL); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
114 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
115 | va_start(args, format); |
| 15884 | 116 | purple_debug_vargs(PURPLE_DEBUG_WARNING, category, format, args); |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
117 | va_end(args); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
118 | } |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
119 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
120 | void |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
121 | purple_debug_error(const gchar *category, const gchar *format, ...) { |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
122 | va_list args; |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
123 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
124 | g_return_if_fail(format != NULL); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
125 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
126 | va_start(args, format); |
| 15884 | 127 | purple_debug_vargs(PURPLE_DEBUG_ERROR, category, format, args); |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
128 | va_end(args); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
129 | } |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
130 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
131 | void |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
132 | purple_debug_fatal(const gchar *category, const gchar *format, ...) { |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
133 | va_list args; |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
134 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
135 | g_return_if_fail(format != NULL); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
136 | |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
137 | va_start(args, format); |
| 15884 | 138 | purple_debug_vargs(PURPLE_DEBUG_FATAL, category, format, args); |
|
6721
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
139 | va_end(args); |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
140 | } |
|
41d2d86860f3
[gaim-migrate @ 7248]
Christian Hammond <chipx86@chipx86.com>
parents:
6483
diff
changeset
|
141 | |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
142 | gboolean |
|
41840
fe350460fb1c
Remove C99-obsoleted constructs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41127
diff
changeset
|
143 | purple_debug_is_verbose(void) { |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
144 | return debug_verbose; |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
145 | } |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
146 | |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
147 | void |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
148 | purple_debug_set_verbose(gboolean verbose) { |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
149 | debug_verbose = verbose; |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
150 | } |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
151 | |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
152 | gboolean |
|
41840
fe350460fb1c
Remove C99-obsoleted constructs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41127
diff
changeset
|
153 | purple_debug_is_unsafe(void) { |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
154 | return debug_unsafe; |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
155 | } |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
156 | |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
157 | void |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
158 | purple_debug_set_unsafe(gboolean unsafe) { |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
159 | debug_unsafe = unsafe; |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
160 | } |
|
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
161 | |
|
34296
d31a4f3b547e
Debug log: optional colored output and no need for add linefeed at the end of each message
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32438
diff
changeset
|
162 | void |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
163 | purple_debug_init(void) { |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
164 | /* Read environment variables once per init */ |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
165 | if(g_getenv("PURPLE_UNSAFE_DEBUG")) { |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
166 | purple_debug_set_unsafe(TRUE); |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
167 | } |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
168 | |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
169 | if(g_getenv("PURPLE_VERBOSE_DEBUG")) { |
|
27542
a7acdc4ba23f
Move the handling of PURPLE_UNSAFE_DEBUG to purple_debug_init(). Also add
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
20147
diff
changeset
|
170 | purple_debug_set_verbose(TRUE); |
|
40828
4ee19005534e
Modernize debug.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
39913
diff
changeset
|
171 | } |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
172 | } |