aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-07-30 17:36:48 +0800
committerMilan Crha <mcrha@redhat.com>2009-07-30 17:36:48 +0800
commit83fd1ad57e4e9968ce3088eb2d9f21dfbfccdebd (patch)
tree27b6c8ab3b9dfadee2edc673bd2b774ec579d4e8
parente004ae81885231237cc92907dbc4fb3e50cea309 (diff)
downloadgsoc2013-evolution-83fd1ad57e4e9968ce3088eb2d9f21dfbfccdebd.tar.gz
gsoc2013-evolution-83fd1ad57e4e9968ce3088eb2d9f21dfbfccdebd.tar.zst
gsoc2013-evolution-83fd1ad57e4e9968ce3088eb2d9f21dfbfccdebd.zip
Bug #514725 - Critical warnings with appointments
-rw-r--r--calendar/gui/e-day-view.c25
-rw-r--r--calendar/gui/e-week-view.c26
2 files changed, 31 insertions, 20 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 1ed1a492bd..f24d5267a4 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -476,11 +476,6 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo
g_return_if_fail (E_IS_DAY_VIEW (day_view));
- if (!E_CALENDAR_VIEW (day_view)->in_focus) {
- e_day_view_free_events (day_view);
- return;
- }
-
/* Calculate the first day that should be shown, based on start_time
and the days_shown setting. If we are showing 1 day it is just the
start of the day given by start_time, otherwise it is the previous
@@ -495,6 +490,11 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo
if (lower != day_view->lower)
e_day_view_recalc_day_starts (day_view, lower);
+ if (!E_CALENDAR_VIEW (day_view)->in_focus) {
+ e_day_view_free_events (day_view);
+ return;
+ }
+
/* If we don't show the new selection, don't preserve it */
if (day_view->selection_start_day == -1 || day_view->days_shown <= day_view->selection_start_day)
e_day_view_set_selected_time_range (E_CALENDAR_VIEW (day_view), start_time, end_time);
@@ -3415,6 +3415,9 @@ e_day_view_update_query (EDayView *day_view)
{
gint rows, r;
+ if (!E_CALENDAR_VIEW (day_view)->in_focus)
+ return;
+
e_day_view_stop_editing_event (day_view);
gtk_widget_queue_draw (day_view->top_canvas);
@@ -4214,11 +4217,13 @@ e_day_view_add_event (ECalComponent *comp,
add_event_data = data;
- /*
- g_print ("Day view lower: %s", ctime (&add_event_data->day_view->lower));
- g_print ("Day view upper: %s", ctime (&add_event_data->day_view->upper));
- g_print ("Event start: %s", ctime (&start));
- g_print ("Event end : %s\n", ctime (&end)); */
+ /*if (end < start || start >= add_event_data->day_view->upper || end < add_event_data->day_view->lower) {
+ g_print ("%s: day_view: %p\n", G_STRFUNC, add_event_data->day_view);
+ g_print ("\tDay view lower: %s", ctime (&add_event_data->day_view->lower));
+ g_print ("\tDay view upper: %s", ctime (&add_event_data->day_view->upper));
+ g_print ("\tEvent start: %s", ctime (&start));
+ g_print ("\tEvent end : %s\n", ctime (&end));
+ }*/
/* Check that the event times are valid. */
g_return_val_if_fail (start <= end, TRUE);
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index f3c3100763..edcffa49da 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -240,11 +240,6 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo
g_return_if_fail (E_IS_WEEK_VIEW (week_view));
- if (!E_CALENDAR_VIEW (week_view)->in_focus) {
- e_week_view_free_events (week_view);
- return;
- }
-
time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
/* Calculate the weekday of the given date, 0 = Mon. */
@@ -286,6 +281,11 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo
if (update_adjustment_value)
gtk_adjustment_set_value (GTK_RANGE (week_view->vscrollbar)->adjustment, 0);
+ if (!E_CALENDAR_VIEW (week_view)->in_focus) {
+ e_week_view_free_events (week_view);
+ return;
+ }
+
gtk_widget_queue_draw (week_view->main_canvas);
/* FIXME Preserve selection if possible */
@@ -1363,6 +1363,9 @@ e_week_view_update_query (EWeekView *week_view)
{
gint rows, r;
+ if (!E_CALENDAR_VIEW (week_view)->in_focus)
+ return;
+
gtk_widget_queue_draw (week_view->main_canvas);
e_week_view_free_events (week_view);
e_week_view_queue_layout (week_view);
@@ -2482,11 +2485,14 @@ e_week_view_add_event (ECalComponent *comp,
/* Check that the event times are valid. */
num_days = add_event_data->week_view->multi_week_view ? add_event_data->week_view->weeks_shown * 7 : 7;
-#if 0
- g_print ("View start:%li end:%li Event start:%li end:%li\n",
- add_event_data->week_view->day_starts[0], add_event_data->week_view->day_starts[num_days],
- start, end);
-#endif
+ /*if (start > end || start >= add_event_data->week_view->day_starts[num_days] || end <= add_event_data->week_view->day_starts[0]) {
+ g_print ("%s: week_view:%p\n", G_STRFUNC, add_event_data->week_view);
+ g_print ("\tstart: %s", ctime (&start));
+ g_print ("\tend: %s", ctime (&end));
+ g_print ("\tday_starts[0]: %s", ctime (&add_event_data->week_view->day_starts[0]));
+ g_print ("\tday_starts[%d]: %s\n", num_days, ctime (&add_event_data->week_view->day_starts[num_days]));
+ }*/
+
g_return_val_if_fail (start <= end, TRUE);
g_return_val_if_fail (start < add_event_data->week_view->day_starts[num_days], TRUE);
g_return_val_if_fail (end > add_event_data->week_view->day_starts[0], TRUE);