diff options
author | Milan Crha <mcrha@redhat.com> | 2010-12-17 01:04:52 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:11 +0800 |
commit | 1ddae03ed906264f203ddc253bec27a4c8d49dd5 (patch) | |
tree | 880e18479d7d5c103211db04074e6d250c0297eb /calendar/gui/alarm-notify/config-data.c | |
parent | d8885dbe7d4cf4736b4895794dc25b0cff0f197e (diff) | |
download | gsoc2013-evolution-1ddae03ed906264f203ddc253bec27a4c8d49dd5.tar.gz gsoc2013-evolution-1ddae03ed906264f203ddc253bec27a4c8d49dd5.tar.zst gsoc2013-evolution-1ddae03ed906264f203ddc253bec27a4c8d49dd5.zip |
Enable debugging of alarm-notify with ALARMS_DEBUG=1 environment variable
Diffstat (limited to 'calendar/gui/alarm-notify/config-data.c')
-rw-r--r-- | calendar/gui/alarm-notify/config-data.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c index 65e3e15a87..eea273cf62 100644 --- a/calendar/gui/alarm-notify/config-data.c +++ b/calendar/gui/alarm-notify/config-data.c @@ -391,3 +391,34 @@ config_data_is_blessed_program (const gchar *program) return found; } + +static gboolean can_debug = FALSE; +static GStaticRecMutex rec_mutex = G_STATIC_REC_MUTEX_INIT; + +void +config_data_init_debugging (void) +{ + can_debug = g_getenv ("ALARMS_DEBUG") != NULL; +} + +/* returns whether started debugging; + call config_data_stop_debugging() when started and you are done with it +*/ +gboolean +config_data_start_debugging (void) +{ + g_static_rec_mutex_lock (&rec_mutex); + + if (can_debug) + return TRUE; + + g_static_rec_mutex_unlock (&rec_mutex); + + return FALSE; +} + +void +config_data_stop_debugging (void) +{ + g_static_rec_mutex_unlock (&rec_mutex); +} |