aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/alarm-notify/config-data.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-11-06 23:20:46 +0800
committerMilan Crha <mcrha@redhat.com>2012-11-06 23:21:37 +0800
commit704b78d23bf8d707707411608a3453250f2637a1 (patch)
tree6bea89936534973c9b467503d198245f5035bc77 /calendar/alarm-notify/config-data.c
parentb6fddaaa0efb8013c526f00926830b9cdcbe0d60 (diff)
downloadgsoc2013-evolution-704b78d23bf8d707707411608a3453250f2637a1.tar
gsoc2013-evolution-704b78d23bf8d707707411608a3453250f2637a1.tar.gz
gsoc2013-evolution-704b78d23bf8d707707411608a3453250f2637a1.tar.bz2
gsoc2013-evolution-704b78d23bf8d707707411608a3453250f2637a1.tar.lz
gsoc2013-evolution-704b78d23bf8d707707411608a3453250f2637a1.tar.xz
gsoc2013-evolution-704b78d23bf8d707707411608a3453250f2637a1.tar.zst
gsoc2013-evolution-704b78d23bf8d707707411608a3453250f2637a1.zip
Replace deprecated GLib symbols (as of GLib 2.34.x)
Diffstat (limited to 'calendar/alarm-notify/config-data.c')
-rw-r--r--calendar/alarm-notify/config-data.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/calendar/alarm-notify/config-data.c b/calendar/alarm-notify/config-data.c
index a2f9a2d448..b9f9b7a07d 100644
--- a/calendar/alarm-notify/config-data.c
+++ b/calendar/alarm-notify/config-data.c
@@ -31,7 +31,6 @@
/* Whether we have initied ourselves by reading
* the data from the configuration engine. */
-static gboolean inited = FALSE;
static GSettings *calendar_settings = NULL;
/* Copied from ../calendar-config.c; returns whether the locale has 'am' and
@@ -47,27 +46,22 @@ locale_supports_12_hour_format (void)
return s[0] != '\0';
}
-static void
-do_cleanup (void)
+void
+config_data_cleanup (void)
{
- g_object_unref (calendar_settings);
- calendar_settings = FALSE;
-
- inited = FALSE;
+ if (calendar_settings)
+ g_object_unref (calendar_settings);
+ calendar_settings = NULL;
}
/* Ensures that the configuration values have been read */
static void
ensure_inited (void)
{
- if (inited)
+ if (calendar_settings)
return;
- inited = TRUE;
-
calendar_settings = g_settings_new ("org.gnome.evolution.calendar");
-
- g_atexit ((GVoidFunc) do_cleanup);
}
icaltimezone *
@@ -287,7 +281,7 @@ config_data_is_blessed_program (const gchar *program)
}
static gboolean can_debug = FALSE;
-static GStaticRecMutex rec_mutex = G_STATIC_REC_MUTEX_INIT;
+static GRecMutex rec_mutex;
void
config_data_init_debugging (void)
@@ -301,12 +295,12 @@ config_data_init_debugging (void)
gboolean
config_data_start_debugging (void)
{
- g_static_rec_mutex_lock (&rec_mutex);
+ g_rec_mutex_lock (&rec_mutex);
if (can_debug)
return TRUE;
- g_static_rec_mutex_unlock (&rec_mutex);
+ g_rec_mutex_unlock (&rec_mutex);
return FALSE;
}
@@ -314,5 +308,5 @@ config_data_start_debugging (void)
void
config_data_stop_debugging (void)
{
- g_static_rec_mutex_unlock (&rec_mutex);
+ g_rec_mutex_unlock (&rec_mutex);
}