Re: [evolution-patches] seek review the patch of bug #45910



On Mon, 2003-07-07 at 09:27, jack wrote: 
> hello Rodrigo, JP or HPJ:
> 
>            Could you review the patch for bug #45910?
>             http://bugzilla.ximian.com/show_bug.cgi?id=45910
> 
>            I found the calclient in the EMeetingModel is null becasue of 
> it can not be set when it initialize.
> so, if you use the e_meeting_model_get_cal_client to get the calclient, 
> the client will be null for ever.
> so, i use the comp_editor_get_cal_client to get the calclient from the 
> CompEditor.
>            In addition, i add the g_return_val_if_fail to check whether 
> the calclient is null.
I think the real problem is that the TaskEditor widget does not implement
the set_cal_client virtual method of its base class (CompEditor). The
attached patch fixes that, so please, could you check if my patch fixes
the crash for you? I can't reproduce it at all.

cheers
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1802.2.12
diff -u -p -r1.1802.2.12 ChangeLog
--- ChangeLog	3 Jul 2003 16:25:28 -0000	1.1802.2.12
+++ ChangeLog	7 Jul 2003 09:18:25 -0000
@@ -1,3 +1,16 @@
+2003-07-07  Rodrigo Moya <rodrigo ximian com>
+
+	Fixes #45910
+
+	* gui/dialogs/task-editor.c (task_editor_class_init): set up the
+	handler for the set_cal_client virtual method.
+	(task_editor_set_cal_client): added missing virtual method.
+
+2003-07-07  Jack Jia <jack jia sun com>
+
+	* cal-client/cal-client.c (cal_client_get_static_capability): add
+	g_return_val_if_fail to check the input param.
+
 2003-07-02  Rodrigo Moya <rodrigo ximian com>
 
 	* gui/alarm-notify/alarm-notify-dialog.c (alarm_notify_dialog): use
Index: cal-client/cal-client.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/cal-client/cal-client.c,v
retrieving revision 1.119.2.1
diff -u -p -r1.119.2.1 cal-client.c
--- cal-client/cal-client.c	2 Jul 2003 13:32:26 -0000	1.119.2.1
+++ cal-client/cal-client.c	7 Jul 2003 09:18:26 -0000
@@ -1310,6 +1310,9 @@ cal_client_get_organizer_must_attend (Ca
 gboolean
 cal_client_get_static_capability (CalClient *client, const char *cap)
 {
+	g_return_val_if_fail (client != NULL, FALSE);
+	g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE);
+
 	return check_capability (client, cap);
 }
 
Index: gui/dialogs/task-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-editor.c,v
retrieving revision 1.63.4.2
diff -u -p -r1.63.4.2 task-editor.c
--- gui/dialogs/task-editor.c	2 Jul 2003 13:32:26 -0000	1.63.4.2
+++ gui/dialogs/task-editor.c	7 Jul 2003 09:18:27 -0000
@@ -50,6 +50,7 @@ struct _TaskEditorPrivate {
 
 static void task_editor_class_init (TaskEditorClass *class);
 static void task_editor_init (TaskEditor *te);
+static void task_editor_set_cal_client (CompEditor *editor, CalClient *client);
 static void task_editor_edit_comp (CompEditor *editor, CalComponent *comp);
 static gboolean task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method);
 static void task_editor_finalize (GObject *object);
@@ -99,6 +100,7 @@ task_editor_class_init (TaskEditorClass 
 
 	parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
 
+	editor_class->set_cal_client = task_editor_set_cal_client;
 	editor_class->edit_comp = task_editor_edit_comp;
 	editor_class->send_comp = task_editor_send_comp;
 
@@ -211,6 +213,21 @@ task_editor_construct (TaskEditor *te, C
 	set_menu_sens (te);
 
 	return te;
+}
+
+static void
+task_editor_set_cal_client (CompEditor *editor, CalClient *client)
+{
+	TaskEditor *te;
+	TaskEditorPrivate *priv;
+
+	te = TASK_EDITOR (editor);
+	priv = te->priv;
+
+	e_meeting_model_set_cal_client (priv->model, client);
+
+	if (parent_class->set_cal_client)
+		parent_class->set_cal_client (editor, client);
 }
 
 static void


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