diff options
author | JP Rosevear <jpr@helixcode.com> | 2000-09-06 18:42:49 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2000-09-06 18:42:49 +0800 |
commit | 51857b1153f08c6fb2dd3fbd4d36e63aeac385bb (patch) | |
tree | ce79a2714414fa3ffdb848a2e7ad6f49187620bb /calendar | |
parent | 5c279839005d2218319fa5546b6e498df753e68e (diff) | |
download | gsoc2013-evolution-51857b1153f08c6fb2dd3fbd4d36e63aeac385bb.tar gsoc2013-evolution-51857b1153f08c6fb2dd3fbd4d36e63aeac385bb.tar.gz gsoc2013-evolution-51857b1153f08c6fb2dd3fbd4d36e63aeac385bb.tar.bz2 gsoc2013-evolution-51857b1153f08c6fb2dd3fbd4d36e63aeac385bb.tar.lz gsoc2013-evolution-51857b1153f08c6fb2dd3fbd4d36e63aeac385bb.tar.xz gsoc2013-evolution-51857b1153f08c6fb2dd3fbd4d36e63aeac385bb.tar.zst gsoc2013-evolution-51857b1153f08c6fb2dd3fbd4d36e63aeac385bb.zip |
Use new cal_component_has_recurrences convenience function
2000-09-06 JP Rosevear <jpr@helixcode.com>
* gui/e-day-view-main-item.c
(e_day_view_main_item_draw_day_event):
Use new cal_component_has_recurrences convenience function
* gui/e-week-view.c (e_week_view_show_popup_menu): ditto
* gui/e-week-view-event-item.c
(e_week_view_event_item_draw_icons):
ditto
* gui/calendar-model.c (calendar_model_value_at): ditto
(calendar_model_value_at): ditto
* gui/e-day-view.c (e_day_view_on_event_click): ditto
(e_day_view_on_event_right_click): ditto
(e_day_view_on_top_canvas_motion): ditto
(e_day_view_on_top_canvas_motion): ditto
(e_day_view_on_main_canvas_motion): ditto
(e_day_view_on_main_canvas_motion): ditto
(e_day_view_reshape_day_event): ditto
* gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event):
ditto
* gui/e-day-view.c (e_day_view_on_long_event_click): ditto
svn path=/trunk/; revision=5220
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 26 | ||||
-rw-r--r-- | calendar/cal-util/cal-recur.c | 1 | ||||
-rw-r--r-- | calendar/gui/calendar-model.c | 11 | ||||
-rw-r--r-- | calendar/gui/e-day-view-main-item.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-day-view-top-item.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 38 | ||||
-rw-r--r-- | calendar/gui/e-week-view-event-item.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 3 |
8 files changed, 48 insertions, 40 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index a61cffcf93..526cefb453 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,31 @@ 2000-09-06 JP Rosevear <jpr@helixcode.com> + * gui/e-day-view-main-item.c (e_day_view_main_item_draw_day_event): + Use new cal_component_has_recurrences convenience function + + * gui/e-week-view.c (e_week_view_show_popup_menu): ditto + + * gui/e-week-view-event-item.c (e_week_view_event_item_draw_icons): + ditto + + * gui/calendar-model.c (calendar_model_value_at): ditto + (calendar_model_value_at): ditto + + * gui/e-day-view.c (e_day_view_on_event_click): ditto + (e_day_view_on_event_right_click): ditto + (e_day_view_on_top_canvas_motion): ditto + (e_day_view_on_top_canvas_motion): ditto + (e_day_view_on_main_canvas_motion): ditto + (e_day_view_on_main_canvas_motion): ditto + (e_day_view_reshape_day_event): ditto + + * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event): + ditto + + * gui/e-day-view.c (e_day_view_on_long_event_click): ditto + +2000-09-06 JP Rosevear <jpr@helixcode.com> + * cal-util/cal-recur.c (cal_recur_generate_instances): Use new convenience functions and only get the recurrence stuff if needed. Free the recurrence stuff if used. diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c index 648e5293e9..5cbabc50c7 100644 --- a/calendar/cal-util/cal-recur.c +++ b/calendar/cal-util/cal-recur.c @@ -562,7 +562,6 @@ cal_recur_generate_instances (CalComponent *comp, cal_component_free_period_list (rdates); cal_component_free_recur_list (exrules); cal_component_free_exdate_list (exdates); - out: cal_component_free_datetime (&dtstart); diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index 51f2c28a35..9abfded4a2 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -536,13 +536,6 @@ get_has_alarms (CalComponent *comp) return retval; } -/* Returns whether the component has any recurrences defined for it */ -static gboolean -get_has_recurrences (CalComponent *comp) -{ - return cal_component_has_rdates (comp) || cal_component_has_rrules (comp); -} - /* Returns whether the completion date has been set on a component */ static gboolean get_is_complete (CalComponent *comp) @@ -674,7 +667,7 @@ calendar_model_value_at (ETableModel *etm, int col, int row) case CAL_COMPONENT_FIELD_ICON: /* FIXME: Also support 'Assigned to me' & 'Assigned to someone else'. */ - if (get_has_recurrences (comp)) + if (cal_component_has_recurrences (comp)) return GINT_TO_POINTER (1); else return GINT_TO_POINTER (0); @@ -683,7 +676,7 @@ calendar_model_value_at (ETableModel *etm, int col, int row) return GINT_TO_POINTER (get_is_complete (comp)); case CAL_COMPONENT_FIELD_RECURRING: - return GINT_TO_POINTER (get_has_recurrences (comp)); + return GINT_TO_POINTER (cal_component_has_recurrences (comp)); case CAL_COMPONENT_FIELD_OVERDUE: return GINT_TO_POINTER (get_is_overdue (comp)); diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 7b2449b7bf..304a07854e 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -571,8 +571,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, } #endif - if (cal_component_has_rrules (comp) - || cal_component_has_rdates (comp)) { + if (cal_component_has_recurrences (comp)) { draw_recurrence_icon = TRUE; num_icons++; } diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 88e30885ca..b6b8a565b5 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -430,8 +430,7 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, icon_x = text_x - icon_x_inc - x; icon_y = item_y + 1 + E_DAY_VIEW_ICON_Y_PAD - y; - if (cal_component_has_rrules (comp) - || cal_component_has_rdates (comp)) { + if (cal_component_has_recurrences (comp)) { gdk_gc_set_clip_origin (gc, icon_x, icon_y); gdk_gc_set_clip_mask (gc, day_view->recurrence_mask); gdk_draw_pixmap (drawable, gc, diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 9e6db8151f..f1a8af615a 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -2277,8 +2277,7 @@ e_day_view_on_long_event_click (EDayView *day_view, && E_TEXT (event->canvas_item)->editing) return; - if (!(cal_component_has_rrules (event->comp) - && cal_component_has_rdates (event->comp)) + if (!(cal_component_has_recurrences (event->comp)) && (pos == E_DAY_VIEW_POS_LEFT_EDGE || pos == E_DAY_VIEW_POS_RIGHT_EDGE)) { if (!e_day_view_find_long_event_days (day_view, event, @@ -2350,8 +2349,7 @@ e_day_view_on_event_click (EDayView *day_view, && E_TEXT (event->canvas_item)->editing) return; - if (!(cal_component_has_rrules (event->comp) - && cal_component_has_rdates (event->comp)) + if (!(cal_component_has_recurrences (event->comp)) && (pos == E_DAY_VIEW_POS_TOP_EDGE || pos == E_DAY_VIEW_POS_BOTTOM_EDGE)) { /* Grab the keyboard focus, so the event being edited is saved @@ -2546,8 +2544,7 @@ e_day_view_on_event_right_click (EDayView *day_view, We could possibly set up another method of checking it. */ not_being_edited = TRUE; - if (cal_component_has_rrules (event->comp) - || cal_component_has_rdates (event->comp)) { + if (cal_component_has_recurrences (event->comp)) { items = 6; context_menu = &recur_child_items[0]; context_menu[0].sensitive = not_being_edited; @@ -2862,10 +2859,11 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, event = &g_array_index (day_view->long_events, EDayViewEvent, day_view->pressed_event_num); - if (!(cal_component_has_rdates (event->comp) - && cal_component_has_rrules (event->comp)) - && (abs (canvas_x - day_view->drag_event_x) > E_DAY_VIEW_DRAG_START_OFFSET - || abs (canvas_y - day_view->drag_event_y) > E_DAY_VIEW_DRAG_START_OFFSET)) { + if (!(cal_component_has_recurrences (event->comp)) + && (abs (canvas_x - day_view->drag_event_x) + > E_DAY_VIEW_DRAG_START_OFFSET + || abs (canvas_y - day_view->drag_event_y) + > E_DAY_VIEW_DRAG_START_OFFSET)) { day_view->drag_event_day = day_view->pressed_event_day; day_view->drag_event_num = day_view->pressed_event_num; day_view->pressed_event_day = -1; @@ -2889,9 +2887,7 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, cursor = day_view->normal_cursor; /* Recurring events can't be resized. */ - if (event && - !(cal_component_has_rrules (event->comp) - && cal_component_has_rdates (event->comp))) { + if (event && !cal_component_has_recurrences (event->comp)) { switch (pos) { case E_DAY_VIEW_POS_LEFT_EDGE: case E_DAY_VIEW_POS_RIGHT_EDGE: @@ -2969,10 +2965,11 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, event = &g_array_index (day_view->events[day_view->pressed_event_day], EDayViewEvent, day_view->pressed_event_num); - if (!(cal_component_has_rrules (event->comp) - && cal_component_has_rdates (event->comp)) - && (abs (canvas_x - day_view->drag_event_x) > E_DAY_VIEW_DRAG_START_OFFSET - || abs (canvas_y - day_view->drag_event_y) > E_DAY_VIEW_DRAG_START_OFFSET)) { + if (!cal_component_has_recurrences (event->comp) + && (abs (canvas_x - day_view->drag_event_x) + > E_DAY_VIEW_DRAG_START_OFFSET + || abs (canvas_y - day_view->drag_event_y) + > E_DAY_VIEW_DRAG_START_OFFSET)) { day_view->drag_event_day = day_view->pressed_event_day; day_view->drag_event_num = day_view->pressed_event_num; day_view->pressed_event_day = -1; @@ -2996,9 +2993,7 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, cursor = day_view->normal_cursor; /* Recurring events can't be resized. */ - if (event && - !(cal_component_has_rrules (event->comp) - && cal_component_has_rdates (event->comp))) { + if (event && !cal_component_has_recurrences (event->comp)) { switch (pos) { case E_DAY_VIEW_POS_LEFT_EDGE: cursor = day_view->move_cursor; @@ -4078,8 +4073,7 @@ e_day_view_reshape_day_event (EDayView *day_view, || ico->palarm.enabled || ico->aalarm.enabled) num_icons++; #endif - if (cal_component_has_rrules (comp) - || cal_component_has_rdates (comp)) + if (cal_component_has_recurrences (comp)) num_icons++; } diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 6924dc705c..c4e3eb4c7d 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -515,8 +515,7 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, } #endif - if (cal_component_has_rdates (comp) - || cal_component_has_rrules (comp)) { + if (cal_component_has_recurrences (comp)) { draw_recurrence_icon = TRUE; num_icons++; } diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index c9caeff732..096c3882d5 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -2990,8 +2990,7 @@ e_week_view_show_popup_menu (EWeekView *week_view, We could possibly set up another method of checking it. */ not_being_edited = TRUE; - if (cal_component_has_rrules (event->comp) - || cal_component_has_rdates (event->comp)) { + if (cal_component_has_recurrences (event->comp)) { num_items = 6; context_menu = &recur_child_items[0]; context_menu[0].sensitive = not_being_edited; |