[evolution] Fixes bug 498712 (bnc) - deleting meetings sometimes does not work properly.



commit ceb57eb3a8bc04eca26d859ff766130d06cb0e54
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Thu May 21 14:12:04 2009 +0530

    Fixes bug 498712 (bnc) - deleting meetings sometimes does not work properly.
---
 calendar/gui/dialogs/delete-comp.c |    6 ++++--
 calendar/gui/dialogs/delete-comp.h |    2 +-
 calendar/gui/e-calendar-table.c    |    6 +-----
 calendar/gui/e-calendar-view.c     |    9 ++++-----
 4 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c
index 3508f38..e5ae1e6 100644
--- a/calendar/gui/dialogs/delete-comp.c
+++ b/calendar/gui/dialogs/delete-comp.c
@@ -167,7 +167,7 @@ cb_toggled_cb (GtkWidget *toggle, gpointer data)
 }
 
 gboolean
-prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *parent)
+prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *parent, gboolean *retract)
 {
 	char *message = NULL;
 	ECalComponentVType type = E_CAL_COMPONENT_NO_TYPE;
@@ -232,13 +232,15 @@ prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *pare
 			GtkTextIter text_iter_start, text_iter_end;
 			GtkTextBuffer *text_buffer;
 
+			*retract = TRUE;
 			text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry));
 			gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
 			gtk_text_buffer_get_end_iter   (text_buffer, &text_iter_end);
 
 			*retract_text = gtk_text_buffer_get_text (text_buffer, &text_iter_start,
 					&text_iter_end, FALSE);
-		}
+		} else
+			*retract = FALSE;
 	}
 
 	gtk_widget_destroy ((GtkWidget *) dialog);
diff --git a/calendar/gui/dialogs/delete-comp.h b/calendar/gui/dialogs/delete-comp.h
index a2f8530..bb4b598 100644
--- a/calendar/gui/dialogs/delete-comp.h
+++ b/calendar/gui/dialogs/delete-comp.h
@@ -33,6 +33,6 @@ gboolean delete_component_dialog (ECalComponent *comp,
 				  gboolean consider_as_untitled,
 				  int n_comps, ECalComponentVType vtype,
 				  GtkWidget *widget);
-gboolean prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *parent);
+gboolean prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *parent, gboolean *retract);
 
 #endif
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index d032066..ac92002 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -947,9 +947,6 @@ check_for_retract (ECalComponent *comp, ECal *client)
 		ret_val = TRUE;
 	}
 
-	if (!ret_val)
-		ret_val = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL;
-
 	g_free (email);
 	return ret_val;
 }
@@ -995,8 +992,7 @@ e_calendar_table_delete_selected (ECalendarTable *cal_table)
 		char *retract_comment = NULL;
 		gboolean retract = FALSE;
 
-		retract = prompt_retract_dialog (comp, &retract_comment, GTK_WIDGET (cal_table));
-		delete = retract;
+		delete = prompt_retract_dialog (comp, &retract_comment, GTK_WIDGET (cal_table), &retract);
 		if (retract) {
 			GList *users = NULL;
 			icalcomponent *icalcomp = NULL, *mod_comp = NULL;
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index ffb08bb..4ceb891 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -1005,9 +1005,6 @@ check_for_retract (ECalComponent *comp, ECal *client)
 		ret_val = TRUE;
 	}
 
-	if (!ret_val)
-		ret_val = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL;
-
 	g_free (email);
 	return ret_val;
 }
@@ -1028,11 +1025,12 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event)
 	if (!e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER))
 		e_cal_component_set_recurid (comp, NULL);
 
+	/*FIXME Retract should be moved to Groupwise features plugin */
 	if (check_for_retract (comp, event->comp_data->client)) {
 		char *retract_comment = NULL;
 		gboolean retract = FALSE;
 
-		retract = prompt_retract_dialog (comp, &retract_comment, GTK_WIDGET (cal_view));
+		delete = prompt_retract_dialog (comp, &retract_comment, GTK_WIDGET (cal_view), &retract);
 		if (retract) {
 			GList *users = NULL;
 			icalcomponent *icalcomp = NULL, *mod_comp = NULL;
@@ -1144,11 +1142,12 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
 	e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
 	vtype = e_cal_component_get_vtype (comp);
 
+	/*FIXME Retract should be moved to Groupwise features plugin */
 	if (check_for_retract (comp, event->comp_data->client)) {
 		char *retract_comment = NULL;
 		gboolean retract = FALSE;
 
-		retract = prompt_retract_dialog (comp, &retract_comment, GTK_WIDGET (cal_view));
+		delete = prompt_retract_dialog (comp, &retract_comment, GTK_WIDGET (cal_view), &retract);
 		if (retract) {
 			GList *users = NULL;
 			icalcomponent *icalcomp = NULL, *mod_comp = NULL;



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