diff options
author | Milan Crha <mcrha@redhat.com> | 2009-07-30 17:36:48 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-11 04:32:27 +0800 |
commit | d1a51187da263fb4366cf539290c8e5bb27d2d4d (patch) | |
tree | 7ea98db1c25db7fb3ce6917ea2494659fb6f4d2b /calendar/gui/e-week-view.c | |
parent | 854c2cd5c84a7c6a38ecf2fc86efb6e474aa32fa (diff) | |
download | gsoc2013-evolution-d1a51187da263fb4366cf539290c8e5bb27d2d4d.tar.gz gsoc2013-evolution-d1a51187da263fb4366cf539290c8e5bb27d2d4d.tar.zst gsoc2013-evolution-d1a51187da263fb4366cf539290c8e5bb27d2d4d.zip |
Bug #514725 - Critical warnings with appointments
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r-- | calendar/gui/e-week-view.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 6012901fcf..69cf5e6ae2 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -617,11 +617,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. */ @@ -663,6 +658,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 */ @@ -1564,6 +1564,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); @@ -2693,11 +2696,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); |