aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/config-data.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-12-17 01:04:52 +0800
committerMilan Crha <mcrha@redhat.com>2010-12-17 01:04:52 +0800
commit5fd00f91ed46f9964032207c9797a348d2b6ca32 (patch)
tree4c2d3d34b3205dc42bcd4b13b5efb96ae5d4aa8d /calendar/gui/alarm-notify/config-data.c
parent27af441d1f0ca1dcbca0175cbfbf99f6482bb743 (diff)
downloadgsoc2013-evolution-5fd00f91ed46f9964032207c9797a348d2b6ca32.tar.gz
gsoc2013-evolution-5fd00f91ed46f9964032207c9797a348d2b6ca32.tar.zst
gsoc2013-evolution-5fd00f91ed46f9964032207c9797a348d2b6ca32.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.c31
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);
+}