From 0f20693b07cb67c64d125cc1b07522826e4f8e00 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 7 Jul 2012 19:22:49 +0200 Subject: Remove the erase flag and legacy deletion code This is no longer needed. Note removal, as well as exception handling, have been moved to separate functions and the cut feature has been merged into the deletion function. Signed-off-by: Lukas Fleischer --- src/apoint.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'src/apoint.c') diff --git a/src/apoint.c b/src/apoint.c index a308b26..b00bc8a 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -213,34 +213,21 @@ 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(struct apoint *apt, enum eraseflg flag) +void apoint_delete(struct apoint *apt) { - int need_check_notify = 0; - LLIST_TS_LOCK(&alist_p); + llist_item_t *i = LLIST_TS_FIND_FIRST(&alist_p, apt, NULL); + int need_check_notify = 0; if (!i) EXIT(_("no such appointment")); - switch (flag) { - case ERASE_CUT: - if (notify_bar()) - need_check_notify = notify_same_item(apt->start); - LLIST_TS_REMOVE(&alist_p, i); - if (need_check_notify) - notify_check_next_app(0); - break; - default: - if (notify_bar()) - need_check_notify = notify_same_item(apt->start); - LLIST_TS_REMOVE(&alist_p, i); - mem_free(apt->mesg); - mem_free(apt); - if (need_check_notify) - notify_check_next_app(0); - break; - } + if (notify_bar()) + need_check_notify = notify_same_item(apt->start); + LLIST_TS_REMOVE(&alist_p, i); + if (need_check_notify) + notify_check_next_app(0); LLIST_TS_UNLOCK(&alist_p); } -- cgit v1.2.3-54-g00ecf