Re: [evolution-patches] 72088, force loading some types in calendar a11y code



JP,
I am not familar with the gtype/gobject code and cannot figure out why. So I find out another way to fix the problem. Please see the attached new patch. This one looks more sane.
   Thanks!
      Harry

Harry Lu wrote:

JP and Rodrigo,
When I run CVS head version of evolution, I found some calendar a11y functions don't work. There are also some warnings in the output: (evolution-2.2:31757): GLib-GObject-WARNING **: gsignal.c:1019: unable to lookup signal "event" of unloaded type `EText' (evolution-2.2:31757): GLib-GObject-CRITICAL **: file gsignal.c: line 822 (g_signal_add_emission_hook): assertion `signal_id > 0' failed (evolution-2.2:31757): GLib-GObject-WARNING **: gsignal.c:1019: unable to lookup signal "event" of unloaded type `GnomeCanvasPixbuf' (evolution-2.2:31757): GLib-GObject-CRITICAL **: file gsignal.c: line 822 (g_signal_add_emission_hook): assertion `signal_id > 0' failed (evolution-2.2:31757): GLib-GObject-WARNING **: gsignal.c:1019: unable to lookup signal "event" of unloaded type `EDayViewMainItem' (evolution-2.2:31757): GLib-GObject-CRITICAL **: file gsignal.c: line 822 (g_signal_add_emission_hook): assertion `signal_id > 0' failed (evolution-2.2:31757): GLib-GObject-WARNING **: gsignal.c:1019: unable to lookup signal "event" of unloaded type `EWeekViewMainItem' (evolution-1.2:31757): GLib-GObject-CRITICAL **: file gsignal.c: line 822 (g_signal_add_emission_hook): assertion `signal_id > 0' failed

As I checked, this might due to the changes in gobject. Some object types are not loaded when we use them.
   Here is a patch to force loading some types. Please review it.
   Thanks!
      Harry

Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2649
diff -u -r1.2649 ChangeLog
--- calendar/ChangeLog	2 Feb 2005 22:56:50 -0000	1.2649
+++ calendar/ChangeLog	3 Feb 2005 07:34:50 -0000
@@ -1,3 +1,11 @@
+2005-02-03  Harry Lu  <harry lu sun com>
+
+	Fix for 72088.
+
+	* gui/gnome-cal.c: (gnome_calendar_class_init),
+	(gnome_calendar_init): move a11y init from class_init to
+	init so that all related types are already loaded.
+
 2005-02-02  Rodney Dawes  <dobey novell com>
 
 	* gui/dialogs/alarm-dialog.c (alarm_dialog_run): Set the border width
Index: calendar/gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.362
diff -u -r1.362 gnome-cal.c
--- calendar/gui/gnome-cal.c	1 Feb 2005 16:05:07 -0000	1.362
+++ calendar/gui/gnome-cal.c	3 Feb 2005 07:35:11 -0000
@@ -395,8 +395,6 @@
 				      "goto_date",1,
 				      G_TYPE_ENUM,
 				      GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK);
-	/* init the accessibility support for gnome_calendar */
-	gnome_calendar_a11y_init ();
 
 }
 
@@ -1412,6 +1410,9 @@
 
 	priv->visible_start = -1;
 	priv->visible_end = -1;
+
+	/* init the accessibility support for gnome_calendar */
+	gnome_calendar_a11y_init ();
 }
 
 static void
Index: a11y/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/a11y/ChangeLog,v
retrieving revision 1.31
diff -u -r1.31 ChangeLog
--- a11y/ChangeLog	2 Feb 2005 02:10:08 -0000	1.31
+++ a11y/ChangeLog	3 Feb 2005 07:35:13 -0000
@@ -1,3 +1,10 @@
+2005-02-03  Harry Lu <harry lu sun com>
+
+	Fix for 72088.
+	
+	* calendar/ea-calendar.c: (gnome_calendar_a11y_init):
+	add a static variable so that we only init once.
+
 2005-02-01  Harry Lu <harry lu sun com>
 
 	Fix for 71924, 71926, 71932 
Index: a11y/calendar/ea-calendar.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-calendar.c,v
retrieving revision 1.5
diff -u -r1.5 ea-calendar.c
--- a11y/calendar/ea-calendar.c	9 Dec 2003 07:09:24 -0000	1.5
+++ a11y/calendar/ea-calendar.c	3 Feb 2005 07:35:17 -0000
@@ -50,13 +50,19 @@
 					   const GValue *param_values,
 					   gpointer data);
 
+static gboolean cal_a11y_initialized = FALSE;
+
 void
 gnome_calendar_a11y_init (void)
 {
-	EA_SET_FACTORY (gnome_calendar_get_type(), ea_gnome_calendar);
+	if (cal_a11y_initialized)
+		return;
+
 	/* we only add focus watcher when accessibility is enabled
 	 */
 	if (atk_get_root ()) {
+		EA_SET_FACTORY (gnome_calendar_get_type(), ea_gnome_calendar);
+
 		g_signal_add_emission_hook (g_signal_lookup ("event", E_TYPE_TEXT),
 					    0, ea_calendar_focus_watcher,
 					    NULL, (GDestroyNotify) NULL);
@@ -81,6 +87,8 @@
 					    NULL, (GDestroyNotify) NULL);
 
 	}
+
+	cal_a11y_initialized = TRUE;
 }
 
 void


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