diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-26 13:29:54 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-30 14:34:35 +0200 |
commit | 02c90ba53a658686bad5cb5f88c555d9eef06399 (patch) | |
tree | 4c9676d9e1bb703bb757cd05c6ce273e073e5c0e /src/interaction.c | |
parent | e1fbee0071ad6bb5d5c17865c5a7b67a63930e7d (diff) | |
download | calcurse-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/interaction.c')
-rw-r--r-- | src/interaction.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/interaction.c b/src/interaction.c index b90d61f..c1febe3 100644 --- a/src/interaction.c +++ b/src/interaction.c @@ -403,9 +403,9 @@ static int day_erase_item(long date, int item_number, enum eraseflg flag) } } if (p->type == EVNT) { - event_delete_bynum(date, day_item_nb(date, item_number, EVNT), flag); + event_delete(p->item.ev, flag); } else if (p->type == APPT) { - apoint_delete_bynum(date, day_item_nb(date, item_number, APPT), flag); + apoint_delete(p->item.apt, flag); } else { if (flag == ERASE_FORCE_ONLY_NOTE) ans = 1; @@ -424,10 +424,9 @@ static int day_erase_item(long date, int item_number, enum eraseflg flag) } if (p->type == RECUR_EVNT) { - recur_event_erase(date, day_item_nb(date, item_number, RECUR_EVNT), - delete_whole, flag); + recur_event_erase(p->item.rev, date, delete_whole, flag); } else { - recur_apoint_erase(date, p->appt_pos, delete_whole, flag); + recur_apoint_erase(p->item.rapt, date, delete_whole, flag); } } if (flag == ERASE_FORCE_ONLY_NOTE) @@ -666,7 +665,7 @@ void interact_todo_delete(void) switch (answer) { case 1: - todo_delete_bynum(todo_hilt() - 1); + todo_delete(todo_get_item(todo_hilt())); todo_set_nb(todo_nb() - 1); if (todo_hilt() > 1) todo_hilt_decrease(1); |