Browse Source

Don't export the debug variable use function.

upstream/xfce4-panel-4.10.1
Nick Schermer 12 years ago
parent
commit
98795060c0
  1. 10
      common/panel-debug.c
  2. 14
      common/panel-debug.h
  3. 8
      panel/panel-plugin-external.c
  4. 6
      panel/panel-window.c

10
common/panel-debug.c

@ -30,7 +30,7 @@
PanelDebugFlag panel_debug_flags = 0;
static PanelDebugFlag panel_debug_flags = 0;
@ -151,6 +151,14 @@ panel_debug_print (PanelDebugFlag domain,
gboolean
panel_debug_has_domain (PanelDebugFlag domain)
{
return PANEL_HAS_FLAG (panel_debug_flags, domain);
}
void
panel_debug (PanelDebugFlag domain,
const gchar *message,

14
common/panel-debug.h

@ -39,14 +39,14 @@ typedef enum
}
PanelDebugFlag;
extern PanelDebugFlag panel_debug_flags;
gboolean panel_debug_has_domain (PanelDebugFlag domain);
void panel_debug (PanelDebugFlag domain,
const gchar *message,
...) G_GNUC_PRINTF (2, 3);
void panel_debug (PanelDebugFlag domain,
const gchar *message,
...) G_GNUC_PRINTF (2, 3);
void panel_debug_filtered (PanelDebugFlag domain,
const gchar *message,
...) G_GNUC_PRINTF (2, 3);
void panel_debug_filtered (PanelDebugFlag domain,
const gchar *message,
...) G_GNUC_PRINTF (2, 3);
#endif /* !__PANEL_DEBUG_H__ */

8
panel/panel-plugin-external.c

@ -503,8 +503,8 @@ panel_plugin_external_child_spawn (PanelPluginExternal *external)
panel_return_if_fail (argv != NULL);
/* check debugging state */
if (PANEL_HAS_FLAG (panel_debug_flags, PANEL_DEBUG_GDB)
|| PANEL_HAS_FLAG (panel_debug_flags, PANEL_DEBUG_VALGRIND))
if (panel_debug_has_domain (PANEL_DEBUG_GDB)
|| panel_debug_has_domain (PANEL_DEBUG_VALGRIND))
{
g_get_current_time (&timestamp);
cmd_line = NULL;
@ -512,7 +512,7 @@ panel_plugin_external_child_spawn (PanelPluginExternal *external)
/* note that if the program was not found in PATH, we already
* warned for it in panel_debug_init, so no need to do that again */
if (PANEL_HAS_FLAG (panel_debug_flags, PANEL_DEBUG_GDB))
if (panel_debug_has_domain (PANEL_DEBUG_GDB))
{
program = g_find_program_in_path ("gdb");
if (G_LIKELY (program != NULL))
@ -531,7 +531,7 @@ panel_plugin_external_child_spawn (PanelPluginExternal *external)
argv[PLUGIN_ARGV_UNIQUE_ID]);
}
}
else if (PANEL_HAS_FLAG (panel_debug_flags, PANEL_DEBUG_VALGRIND))
else if (panel_debug_has_domain (PANEL_DEBUG_VALGRIND))
{
program = g_find_program_in_path ("valgrind");
if (G_LIKELY (program != NULL))

6
panel/panel-window.c

@ -1507,7 +1507,7 @@ panel_window_screen_struts_set (PanelWindow *window)
if (gdk_error_trap_pop () != 0)
g_critical ("Failed to set the struts");
if (G_UNLIKELY (panel_debug_flags != 0))
if (panel_debug_has_domain (PANEL_DEBUG_YES))
{
n = -1;
@ -1693,7 +1693,7 @@ panel_window_display_layout_debug (GtkWidget *widget)
gchar *name;
panel_return_if_fail (GTK_IS_WIDGET (widget));
panel_return_if_fail (panel_debug_flags != 0);
panel_return_if_fail (panel_debug_has_domain (PANEL_DEBUG_YES));
str = g_string_new (NULL);
@ -1760,7 +1760,7 @@ panel_window_screen_layout_changed (GdkScreen *screen,
return;
/* print the display layout when debugging is enabled */
if (G_UNLIKELY (panel_debug_flags != 0))
if (G_UNLIKELY (panel_debug_has_domain (PANEL_DEBUG_YES)))
panel_window_display_layout_debug (GTK_WIDGET (window));
/* update the struts edge of this window and check if we need to force

Loading…
Cancel
Save