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>
This commit is contained in:
@@ -155,13 +155,12 @@ struct event *event_scan(FILE * f, struct tm start, int id, char *note)
|
||||
}
|
||||
|
||||
/* Delete an event from the list. */
|
||||
void event_delete_bynum(long start, unsigned num, enum eraseflg flag)
|
||||
void event_delete(struct event *ev, enum eraseflg flag)
|
||||
{
|
||||
llist_item_t *i = LLIST_FIND_NTH(&eventlist, num, &start, event_inday);
|
||||
llist_item_t *i = LLIST_FIND_FIRST(&eventlist, ev, NULL);
|
||||
|
||||
if (!i)
|
||||
EXIT(_("no such appointment"));
|
||||
struct event *ev = LLIST_TS_GET_DATA(i);
|
||||
|
||||
switch (flag) {
|
||||
case ERASE_FORCE_ONLY_NOTE:
|
||||
|
||||
Reference in New Issue
Block a user