[evolution-patches] patch for alarm daemon in 1.4



hi

The attached patch fixes the remaining problems in the alarm daemon for
1.4.x: mainly, make sure only one e-alarm-daemon process is saved to the
session, so that we don't get crashes on startup when more than one daemon
is started.

It does not fix though the problem with gconfd-2 and b-a-s being kept
running after the session is closed. It does not fix that because it's not
the alarm daemon that leaks those. I have been running several sessions
with no alarm daemon process installed, and gconfd-2 and b-a-s were still
running after running that session with no alarm daemon at all.

I suspect the evo GUI might be the culprit, and am investigating that now,
although I'm having many crashes on gdb and valgrind trying to run the evo
GUI :-(

cheers

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1802.2.42
diff -u -p -r1.1802.2.42 ChangeLog
--- ChangeLog	4 Feb 2004 05:47:22 -0000	1.1802.2.42
+++ ChangeLog	17 Feb 2004 12:09:34 -0000
@@ -1,4 +1,13 @@
-2004-02-04 Yong Sun <Yong Sun sun com>
+2004-02-17  Rodrigo Moya <rodrigo ximian com>
+
+	* gui/alarm-notify/notify-main.c: (init_session): just set the
+	daemon's restart style, not the restart command. Connect to
+	save_yourself" signal on the session also.
+	(save_session_cb): set the restart command here.
+
+	* gui/alarm-notify/Makefile.am: added EVOLUTION_LIBEXECDIR.
+
+2004-02-04  Yong Sun <Yong Sun sun com>
 
 	* gui/print.c: Fix a bug in evolution/calendar/gui/print.c:
 	bound_text(). It does not break lines with the correct boundary of UTF-8
Index: gui/alarm-notify/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/Makefile.am,v
retrieving revision 1.32
diff -u -p -r1.32 Makefile.am
--- gui/alarm-notify/Makefile.am	11 Jun 2003 04:09:30 -0000	1.32
+++ gui/alarm-notify/Makefile.am	17 Feb 2004 12:09:34 -0000
@@ -28,6 +28,7 @@ INCLUDES = 						\
 	-DEVOLUTION_GLADEDIR=\""$(gladedir)"\"		\
 	-DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\"	\
 	-DEVOLUTION_LOCALEDIR=\""$(localedir)"\"	\
+	-DEVOLUTION_LIBEXECDIR=\""$(privlibexecdir)"\"	\
 	$(EVOLUTION_CALENDAR_CFLAGS)
 
 glade_DATA =		\
@@ -72,4 +73,4 @@ BUILT_SOURCES = $(CORBA_GENERATED) $(ser
 CLEANFILES = $(BUILT_SOURCES)
 
 dist-hook:
-	cd $(distdir); rm -f $(BUILT_SOURCES)
\ No newline at end of file
+	cd $(distdir); rm -f $(BUILT_SOURCES)
Index: gui/alarm-notify/notify-main.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/notify-main.c,v
retrieving revision 1.25.4.3
diff -u -p -r1.25.4.3 notify-main.c
--- gui/alarm-notify/notify-main.c	24 Jan 2004 23:50:41 -0000	1.25.4.3
+++ gui/alarm-notify/notify-main.c	17 Feb 2004 12:09:35 -0000
@@ -57,15 +57,28 @@ client_die_cb (GnomeClient *client)
 	bonobo_main_quit ();
 }
 
+static gint
+save_session_cb (GnomeClient *client, GnomeSaveStyle save_style, gint shutdown,
+		 GnomeInteractStyle interact_style, gint fast, gpointer user_data)
+{
+	char *args[2];
+
+	args[0] = EVOLUTION_LIBEXECDIR "/evolution-alarm-notify";
+	args[1] = NULL;
+
+	gnome_client_set_restart_command (master_client, 1, args);
+
+	return TRUE;
+}
+
 /* Sees if a session manager is present.  If so, it tells the SM how to restart
  * the daemon when the session starts.  It also sets the die callback so that
  * the daemon can terminate properly when the session ends.
  */
 static void
-set_session_parameters (char **argv)
+init_session (void)
 {
 	int flags;
-	char *args[2];
 
 	master_client = gnome_master_client ();
 	flags = gnome_client_get_flags (master_client);
@@ -77,15 +90,12 @@ set_session_parameters (char **argv)
 	 * the session starts.  The daemon will take care of loading whatever
 	 * calendars it was told to load.
 	 */
-	gnome_client_set_restart_style (master_client, GNOME_RESTART_ANYWAY);
-
-	args[0] = argv[0];
-	args[1] = NULL;
-
-	gnome_client_set_restart_command (master_client, 1, args);
+	gnome_client_set_restart_style (master_client, GNOME_RESTART_IF_RUNNING);
 
 	g_signal_connect (G_OBJECT (master_client), "die",
 			  G_CALLBACK (client_die_cb), NULL);
+	g_signal_connect (G_OBJECT (master_client), "save_yourself",
+			  G_CALLBACK (save_session_cb), NULL);
 }
 
 /* Factory function for the alarm notify service; just creates and references a
@@ -183,7 +193,7 @@ main (int argc, char **argv)
 	if (!factory)
 		g_error (_("Could not create the alarm notify service factory"));
 
-	set_session_parameters (argv);
+	init_session ();
 
 	g_idle_add ((GSourceFunc) load_calendars, NULL);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]