From e875bd691c9d0d57bb3e93907f54a2481b37c413 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Tue, 9 Aug 2005 19:54:55 +0000 Subject: Fixes #310438 svn path=/trunk/; revision=30054 --- calendar/ChangeLog | 11 +++++++++++ calendar/gui/tasks-component.c | 24 ++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 427c7e08fc..f88c237c22 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,14 @@ +2005-08-10 Dinesh Layek < LDinesh@novell.com > + + Fixes #310438 + * 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-08-05 Chenthill Palanisamy * gui/e-cal-component-preview.c: (write_html): Using format diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 702a0a730d..778c55f6c3 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -743,10 +743,10 @@ selector_tree_drag_data_received (GtkWidget *widget, 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 +758,25 @@ selector_tree_drag_data_received (GtkWidget *widget, if (client) { if (e_cal_open (client, TRUE, NULL)) { - success = TRUE; - update_objects (client, icalcomp); + 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 task list: %s",error->message); + else { + success = TRUE; + update_objects (client, icalcomp); + } + + g_clear_error (&error); + } else + icalcomponent_free (tmp_icalcomp); } - + g_object_unref (client); } - + icalcomponent_free (icalcomp); } -- cgit