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:
@@ -269,17 +269,15 @@ struct apoint *apoint_scan(FILE * f, struct tm start, struct tm end, char state,
|
||||
return apoint_new(buf, note, tstart, tend - tstart, state);
|
||||
}
|
||||
|
||||
void apoint_delete_bynum(long start, unsigned num, enum eraseflg flag)
|
||||
void apoint_delete(struct apoint *apt, enum eraseflg flag)
|
||||
{
|
||||
llist_item_t *i;
|
||||
int need_check_notify = 0;
|
||||
|
||||
LLIST_TS_LOCK(&alist_p);
|
||||
i = LLIST_TS_FIND_NTH(&alist_p, num, &start, apoint_inday);
|
||||
llist_item_t *i = LLIST_TS_FIND_FIRST(&alist_p, apt, NULL);
|
||||
|
||||
if (!i)
|
||||
EXIT(_("no such appointment"));
|
||||
struct apoint *apt = LLIST_TS_GET_DATA(i);
|
||||
|
||||
switch (flag) {
|
||||
case ERASE_FORCE_ONLY_NOTE:
|
||||
|
||||
Reference in New Issue
Block a user