Rework generic item container

Instead of copying all members of the individual item structures to a
generic structure containing all fields, create compulsory fields only
and set up a pointer to the actual item. This results in lower memory
footprint and lets us clean up some code.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-06-25 11:51:59 +02:00
parent cbc5d46880
commit 52bfc54333
3 changed files with 134 additions and 90 deletions

View File

@@ -902,11 +902,13 @@ void recur_repeat_item(void)
date = calendar_get_slctd_day_sec();
if (p->type == EVNT) {
recur_event_new(p->mesg, p->note, p->start, p->evnt_id, type, freq,
until, NULL);
struct event *ev = p->item.ev;
recur_event_new(ev->mesg, ev->note, ev->day, ev->id, type, freq, until,
NULL);
} else if (p->type == APPT) {
ra = recur_apoint_new(p->mesg, p->note, p->start, p->appt_dur,
p->state, type, freq, until, NULL);
struct apoint *apt = p->item.apt;
ra = recur_apoint_new(apt->mesg, apt->note, apt->start, apt->dur,
apt->state, type, freq, until, NULL);
if (notify_bar())
notify_check_repeated(ra);
} else {