summaryrefslogtreecommitdiff
path: root/src/apoint.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-07-07 19:22:49 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-07-07 21:40:56 +0200
commit0f20693b07cb67c64d125cc1b07522826e4f8e00 (patch)
tree318e55e4021c3c57d1753d7665241e4f6e2fb7f2 /src/apoint.c
parent13c21ac28023542a10cb75c085ce1925da2cdd0e (diff)
downloadcalcurse-0f20693b07cb67c64d125cc1b07522826e4f8e00.zip
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>
Diffstat (limited to 'src/apoint.c')
-rw-r--r--src/apoint.c29
1 files changed, 8 insertions, 21 deletions
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);
}