aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/alarm-notify
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-08-30 21:37:11 +0800
committerMilan Crha <mcrha@redhat.com>2012-08-30 21:37:11 +0800
commit350f7118fec5b5d7bcf6a6c40d2fba6bedaf512e (patch)
tree095c36fe06e9b413ccd7d80c76ea8fe9bf5e8339 /calendar/alarm-notify
parentd34fc73590606c129cd4f72ec3b0960243217318 (diff)
downloadgsoc2013-evolution-350f7118fec5b5d7bcf6a6c40d2fba6bedaf512e.tar
gsoc2013-evolution-350f7118fec5b5d7bcf6a6c40d2fba6bedaf512e.tar.gz
gsoc2013-evolution-350f7118fec5b5d7bcf6a6c40d2fba6bedaf512e.tar.bz2
gsoc2013-evolution-350f7118fec5b5d7bcf6a6c40d2fba6bedaf512e.tar.lz
gsoc2013-evolution-350f7118fec5b5d7bcf6a6c40d2fba6bedaf512e.tar.xz
gsoc2013-evolution-350f7118fec5b5d7bcf6a6c40d2fba6bedaf512e.tar.zst
gsoc2013-evolution-350f7118fec5b5d7bcf6a6c40d2fba6bedaf512e.zip
Make sure evolution-alarm-notify is running on Evolution's start
Diffstat (limited to 'calendar/alarm-notify')
-rw-r--r--calendar/alarm-notify/alarm-notify.c27
-rw-r--r--calendar/alarm-notify/notify-main.c14
2 files changed, 29 insertions, 12 deletions
diff --git a/calendar/alarm-notify/alarm-notify.c b/calendar/alarm-notify/alarm-notify.c
index 3738a7c359..dc588b726c 100644
--- a/calendar/alarm-notify/alarm-notify.c
+++ b/calendar/alarm-notify/alarm-notify.c
@@ -135,19 +135,12 @@ alarm_notify_startup (GApplication *application)
static void
alarm_notify_activate (GApplication *application)
{
- /* Disregard. This is just here to prevent the default
- * activate method from running, which issues a warning
- * if there are no handlers connected to this signal. */
-}
+ AlarmNotify *an = ALARM_NOTIFY (application);
-static gboolean
-alarm_notify_initable (GInitable *initable,
- GCancellable *cancellable,
- GError **error)
-{
- AlarmNotify *an = ALARM_NOTIFY (initable);
-
- an->priv->registry = e_source_registry_new_sync (cancellable, error);
+ if (g_application_get_is_remote (application)) {
+ g_application_quit (application);
+ return;
+ }
if (an->priv->registry != NULL) {
alarm_notify_load_calendars (an);
@@ -160,6 +153,16 @@ alarm_notify_initable (GInitable *initable,
an->priv->registry, "source-removed",
G_CALLBACK (alarm_notify_remove_calendar), an);
}
+}
+
+static gboolean
+alarm_notify_initable (GInitable *initable,
+ GCancellable *cancellable,
+ GError **error)
+{
+ AlarmNotify *an = ALARM_NOTIFY (initable);
+
+ an->priv->registry = e_source_registry_new_sync (cancellable, error);
return (an->priv->registry != NULL);
}
diff --git a/calendar/alarm-notify/notify-main.c b/calendar/alarm-notify/notify-main.c
index 2b04104417..c112331a3d 100644
--- a/calendar/alarm-notify/notify-main.c
+++ b/calendar/alarm-notify/notify-main.c
@@ -99,6 +99,20 @@ main (gint argc,
exit (EXIT_FAILURE);
}
+ g_application_register (G_APPLICATION (alarm_notify_service), NULL, &error);
+
+ if (error != NULL) {
+ g_printerr ("%s\n", error->message);
+ g_error_free (error);
+ g_object_unref (alarm_notify_service);
+ exit (EXIT_FAILURE);
+ }
+
+ if (g_application_get_is_remote (G_APPLICATION (alarm_notify_service))) {
+ g_object_unref (alarm_notify_service);
+ return 0;
+ }
+
exit_status = g_application_run (
G_APPLICATION (alarm_notify_service), argc, argv);