aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/alarm-notify
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
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')
-rw-r--r--calendar/alarm-notify/config-data.c26
-rw-r--r--calendar/alarm-notify/config-data.h2
-rw-r--r--calendar/alarm-notify/notify-main.c2
3 files changed, 14 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);
}
diff --git a/calendar/alarm-notify/config-data.h b/calendar/alarm-notify/config-data.h
index c97c0f7415..d30781c693 100644
--- a/calendar/alarm-notify/config-data.h
+++ b/calendar/alarm-notify/config-data.h
@@ -29,6 +29,8 @@
#include <libical/ical.h>
#include <libecal/libecal.h>
+void config_data_cleanup (void);
+
icaltimezone * config_data_get_timezone (void);
gboolean config_data_get_24_hour_format (void);
gboolean config_data_get_notify_with_tray
diff --git a/calendar/alarm-notify/notify-main.c b/calendar/alarm-notify/notify-main.c
index c112331a3d..3643ae65e7 100644
--- a/calendar/alarm-notify/notify-main.c
+++ b/calendar/alarm-notify/notify-main.c
@@ -31,6 +31,7 @@
#include <glib/gi18n.h>
#include "alarm-notify.h"
+#include "config-data.h"
#ifdef G_OS_WIN32
#include <windows.h>
@@ -117,6 +118,7 @@ main (gint argc,
G_APPLICATION (alarm_notify_service), argc, argv);
g_object_unref (alarm_notify_service);
+ config_data_cleanup ();
return exit_status;
}