aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
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 /modules/calendar
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 'modules/calendar')
-rw-r--r--modules/calendar/Makefile.am2
-rw-r--r--modules/calendar/e-cal-shell-backend.c32
2 files changed, 34 insertions, 0 deletions
diff --git a/modules/calendar/Makefile.am b/modules/calendar/Makefile.am
index 0bcc72cfde..c5e547549a 100644
--- a/modules/calendar/Makefile.am
+++ b/modules/calendar/Makefile.am
@@ -3,6 +3,8 @@ module_LTLIBRARIES = module-calendar.la
module_calendar_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DG_LOG_DOMAIN=\"calendar-modules\" \
+ -DEVOLUTION_BINDIR=\""$(bindir)"\" \
+ -DEVOLUTION_PRIVLIBEXECDIR=\""$(PRIVLIBEXECDIR)"\" \
-I$(top_srcdir) \
-I$(top_srcdir)/widgets \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index 44179dc934..cb5fb243e9 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -564,6 +564,36 @@ cal_shell_backend_window_added_cb (EShellBackend *shell_backend,
}
static void
+ensure_alarm_notify_is_running (void)
+{
+ const gchar *base_dir;
+ gchar *filename;
+
+ #ifdef G_OS_WIN32
+ base_dir = EVOLUTION_BINDIR;
+ #else
+ base_dir = EVOLUTION_PRIVLIBEXECDIR;
+ #endif
+
+ filename = g_build_filename (base_dir, "evolution-alarm-notify", NULL);
+
+ if (g_file_test (filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE)) {
+ gchar *argv[2];
+ GError *error = NULL;
+
+ argv[0] = filename;
+ argv[1] = NULL;
+
+ if (!g_spawn_async (base_dir, argv, NULL, 0, NULL, NULL, NULL, &error))
+ g_message ("Failed to start '%s': %s", filename, error ? error->message : "Unknown error");
+
+ g_clear_error (&error);
+ }
+
+ g_free (filename);
+}
+
+static void
cal_shell_backend_constructed (GObject *object)
{
EShell *shell;
@@ -607,6 +637,8 @@ cal_shell_backend_constructed (GObject *object)
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_cal_shell_backend_parent_class)->constructed (object);
+
+ ensure_alarm_notify_is_running ();
}
static void