[evolution-patches] fix for for bug #310438



Hi,
The patch for bug #310438 is attached here.
Please Review.

Regards,


Dinesh Layek
Novell Software Developement(I) Pvt. Ltd,
www.novell.com
Phone No. 080-25731856 Extn. 2140

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	5 Aug 2005 12:24:19 -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	5 Aug 2005 12:24:19 -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);	
 }
 
@@ -725,6 +724,7 @@ selector_tree_drag_data_received (GtkWid
 	GtkTreeIter iter;
 	gboolean success = FALSE;
 	icalcomponent *icalcomp = NULL;
+	icalcomponent *tmp_icalcomp = NULL;
 	ECal *client = NULL;
 
 	if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget),
@@ -743,10 +743,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 +757,14 @@ selector_tree_drag_data_received (GtkWid
 		
 		if (client) {
 			if (e_cal_open (client, TRUE, NULL)) {
-				success = TRUE;
-				update_objects (client, icalcomp);
+				uid = icalcomponent_get_uid (icalcomp);
+				if (!e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL)) {
+					success = TRUE;
+					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	5 Aug 2005 12:24:22 -0000
@@ -1,3 +1,11 @@
+2005-08-05  Dinesh Layek  < LDinesh novell com >
+
+        * gui/e-tasks.c:
+        (table_drag_data_delete): checked wheather data has been dropped successfully, before removing the e_cal_object
+
+        * gui/tasks-component.c:
+	(selector_tree_drag_data_received): made the success flag false when the source and destination calendars are same
+
 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]