evolution r34907 - in trunk/calendar: . gui



Author: msuman
Date: Mon Jan 28 04:46:58 2008
New Revision: 34907
URL: http://svn.gnome.org/viewvc/evolution?rev=34907&view=rev

Log:
Patch from Milan Crha  <mcrha redhat com>  ** Fix for bug #355864 (Calendar critical warning when unchecking a webcal)

Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/gui/e-week-view.c

Modified: trunk/calendar/gui/e-week-view.c
==============================================================================
--- trunk/calendar/gui/e-week-view.c	(original)
+++ trunk/calendar/gui/e-week-view.c	Mon Jan 28 04:46:58 2008
@@ -1926,19 +1926,33 @@
 	e_cal_model_free_component_data (event->comp_data);
 	event->comp_data = NULL;
 
-	/* We leave the span elements in the array, but set the canvas item
-	   pointers to NULL. */
-	for (span_num = 0; span_num < event->num_spans; span_num++) {
-		span = &g_array_index (week_view->spans, EWeekViewEventSpan,
-				       event->spans_index + span_num);
+	if (week_view->spans) {
+		/* We leave the span elements in the array, but set the canvas item
+		   pointers to NULL. */
+		for (span_num = 0; span_num < event->num_spans; span_num++) {
+			span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+					       event->spans_index + span_num);
 
-		if (span->text_item) {
-			gtk_object_destroy (GTK_OBJECT (span->text_item));
-			span->text_item = NULL;
+			if (span->text_item) {
+				gtk_object_destroy (GTK_OBJECT (span->text_item));
+				span->text_item = NULL;
+			}
+			if (span->background_item) {
+				gtk_object_destroy (GTK_OBJECT (span->background_item));
+				span->background_item = NULL;
+			}
 		}
-		if (span->background_item) {
-			gtk_object_destroy (GTK_OBJECT (span->background_item));
-			span->background_item = NULL;
+
+		/* Update event_num numbers for already created spans with event_num higher than our event_num */
+		for (span_num = 0; span_num < week_view->spans->len; span_num++) {
+			span = &g_array_index (week_view->spans, EWeekViewEventSpan, span_num);
+
+			if (span && span->background_item && E_IS_WEEK_VIEW_EVENT_ITEM (span->background_item)) {
+				EWeekViewEventItem *wveitem = E_WEEK_VIEW_EVENT_ITEM (span->background_item);
+
+				if (wveitem->event_num > event_num)
+					wveitem->event_num--;
+			}
 		}
 	}
 



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