summaryrefslogtreecommitdiff
path: root/src/day.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-06-26 13:29:54 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-06-30 14:34:35 +0200
commit02c90ba53a658686bad5cb5f88c555d9eef06399 (patch)
tree4c9676d9e1bb703bb757cd05c6ce273e073e5c0e /src/day.c
parente1fbee0071ad6bb5d5c17865c5a7b67a63930e7d (diff)
downloadcalcurse-02c90ba53a658686bad5cb5f88c555d9eef06399.zip
Revise *_delete{,_bynum}()
Always pass an item instead of passing a date and a index. This makes use of the NULL callback that was added with one of the previous patches. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/day.c')
-rw-r--r--src/day.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/day.c b/src/day.c
index a0b119f..e4a0265 100644
--- a/src/day.c
+++ b/src/day.c
@@ -607,17 +607,16 @@ int day_cut_item(long date, int item_number)
p = day_get_item(item_number);
switch (p->type) {
case EVNT:
- event_delete_bynum(date, day_item_nb(date, item_number, EVNT), ERASE_CUT);
+ event_delete(p->item.ev, ERASE_CUT);
break;
case RECUR_EVNT:
- recur_event_erase(date, day_item_nb(date, item_number, RECUR_EVNT),
- DELETE_WHOLE, ERASE_CUT);
+ recur_event_erase(p->item.rev, date, DELETE_WHOLE, ERASE_CUT);
break;
case APPT:
- apoint_delete_bynum(date, day_item_nb(date, item_number, APPT), ERASE_CUT);
+ apoint_delete(p->item.apt, ERASE_CUT);
break;
case RECUR_APPT:
- recur_apoint_erase(date, p->appt_pos, DELETE_WHOLE, ERASE_CUT);
+ recur_apoint_erase(p->item.rapt, date, DELETE_WHOLE, ERASE_CUT);
break;
default:
EXIT(_("unknwon type"));