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 <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-07-07 19:22:49 +02:00
parent 13c21ac280
commit 0f20693b07
5 changed files with 27 additions and 82 deletions

View File

@@ -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);
}