Re: [evolution-patches] fix for for bug #310438



Changes are made as per suggestions . The revised fix is attached.
please review.

Regards,
Dinesh


On Tue, 2005-08-09 at 02:01 +0530, chen wrote:
> On Fri, 2005-08-05 at 06:30 -0600, Dinesh Layek wrote:
> +       icalcomponent *tmp_icalcomp = NULL;
>    This should be declared inside the following block 
>  
> if (e_cal_open (client, TRUE, NULL)) {d 
> -                       
> The calendar needs to be opened first before making any calls to it, the
> call should not be removed.
> 
> > if (!e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL)) {
> The tmp_icalcomp should be freed using the icalcomponent_free, if the
> component, if it returns TRUE. The error value should be checked here,
> instead of passing NULL to it.
> 
> Please correct the typo errors in the ChangeLog
> 
> 
> thanks, chenthill.
> 
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
Index: gui/e-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.c,v
retrieving revision 1.117
diff -u -p -r1.117 e-tasks.c
--- gui/e-tasks.c	22 Jul 2005 07:38:37 -0000	1.117
+++ gui/e-tasks.c	9 Aug 2005 10:43:46 -0000
@@ -461,7 +461,6 @@ table_drag_data_delete (ETable         *
 	ECalModelComponent *comp_data;
 	ECalModel *model;
 	gboolean read_only = TRUE;
-	
 	priv = tasks->priv;
 	
 	model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
@@ -471,7 +470,8 @@ table_drag_data_delete (ETable         *
 	if (read_only)
 		return;
 
-	e_cal_remove_object (comp_data->client, icalcomponent_get_uid (comp_data->icalcomp), NULL);
+	if(gdk_drag_drop_succeeded(context))
+		e_cal_remove_object (comp_data->client, icalcomponent_get_uid (comp_data->icalcomp), NULL);
 }
 
 #define E_TASKS_TABLE_DEFAULT_STATE					\
Index: gui/tasks-component.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-component.c,v
retrieving revision 1.88
diff -u -p -r1.88 tasks-component.c
--- gui/tasks-component.c	23 Jun 2005 09:11:05 -0000	1.88
+++ gui/tasks-component.c	9 Aug 2005 10:43:47 -0000
@@ -664,7 +664,6 @@ update_single_object (ECal *client, ical
 	
 	if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL))
 		return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL);
-
 	return e_cal_create_object (client, icalcomp, &uid, NULL);	
 }
 
@@ -743,10 +742,9 @@ selector_tree_drag_data_received (GtkWid
 		goto finish;
 
 	icalcomp = icalparser_parse_string (data->data);
-	
+
 	if (icalcomp) {
 		char * uid;
-
 		/* FIXME deal with GDK_ACTION_ASK */
 		if (context->action == GDK_ACTION_COPY) {
 			uid = e_cal_component_gen_uid ();
@@ -758,13 +756,21 @@ selector_tree_drag_data_received (GtkWid
 		
 		if (client) {
 			if (e_cal_open (client, TRUE, NULL)) {
-				success = TRUE;
+				icalcomponent *tmp_icalcomp = NULL;
+				GError *error = NULL;
+				uid = icalcomponent_get_uid (icalcomp);
+				if (!e_cal_get_object (client, uid, NULL, &tmp_icalcomp, &error)) {
+			        	if ((error != NULL) && (error->code != E_CALENDAR_STATUS_OBJECT_NOT_FOUND))
+						 g_message ("Failed to search the object in destination calendar: %s",error->message);
+					else
+						success = TRUE;
+					g_clear_error (&error);
+				}else
+					icalcomponent_free (tmp_icalcomp);
 				update_objects (client, icalcomp);
 			}
-			
 			g_object_unref (client);
 		}
-		
 		icalcomponent_free (icalcomp);
 	}
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2780
diff -u -p -r1.2780 ChangeLog
--- ChangeLog	25 Jul 2005 11:50:54 -0000	1.2780
+++ ChangeLog	9 Aug 2005 10:44:03 -0000
@@ -1,3 +1,10 @@
+2005-08-09  Dinesh Layek  < LDinesh novell com >
+
+        * gui/e-tasks.c:
+        (table_drag_data_delete): removing e_cal_object only when  the success flag is true
+        * gui/tasks-component.c:
+	(selector_tree_drag_data_received): made the success flag FALSE when the data is already present in the destination calendar, and TRUE otherwise
+
 2005-07-25  Chenthill Palanisamy  <pchenthill novell com>
 
 	* gui/e-cal-popup.c: 


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