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/recur.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/recur.c')
-rw-r--r-- | src/recur.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/recur.c b/src/recur.c index 212a98d..f458a66 100644 --- a/src/recur.c +++ b/src/recur.c @@ -695,16 +695,13 @@ unsigned recur_event_inday(struct recur_event *rev, long *day_start) * or delete only one occurence of the recurrent event. */ void -recur_event_erase(long start, unsigned num, unsigned delete_whole, +recur_event_erase(struct recur_event *rev, long start, unsigned delete_whole, enum eraseflg flag) { - llist_item_t *i; - - i = LLIST_FIND_NTH(&recur_elist, num, &start, recur_event_inday); + llist_item_t *i = LLIST_FIND_FIRST(&recur_elist, rev, NULL); if (!i) EXIT(_("event not found")); - struct recur_event *rev = LLIST_GET_DATA(i); if (delete_whole) { switch (flag) { @@ -736,17 +733,14 @@ recur_event_erase(long start, unsigned num, unsigned delete_whole, * or delete only one occurence of the recurrent appointment. */ void -recur_apoint_erase(long start, unsigned num, unsigned delete_whole, - enum eraseflg flag) +recur_apoint_erase(struct recur_apoint *rapt, long start, + unsigned delete_whole, enum eraseflg flag) { - llist_item_t *i; + llist_item_t *i = LLIST_TS_FIND_FIRST(&recur_alist_p, rapt, NULL); int need_check_notify = 0; - i = LLIST_TS_FIND_NTH(&recur_alist_p, num, &start, recur_apoint_inday); - if (!i) EXIT(_("appointment not found")); - struct recur_apoint *rapt = LLIST_GET_DATA(i); LLIST_TS_LOCK(&recur_alist_p); if (notify_bar() && flag != ERASE_FORCE_ONLY_NOTE) |