summaryrefslogtreecommitdiff
path: root/src/recur.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-06-25 11:51:59 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-06-30 14:34:33 +0200
commit52bfc54333d5795900970eeceee704fef4667873 (patch)
tree11bfdfe2968c20969e2b6f9eba8567c02be06753 /src/recur.c
parentcbc5d4688058a117b395707b8ae1426f08984cf8 (diff)
downloadcalcurse-52bfc54333d5795900970eeceee704fef4667873.zip
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>
Diffstat (limited to 'src/recur.c')
-rw-r--r--src/recur.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/recur.c b/src/recur.c
index e8ddffc..785f4dd 100644
--- a/src/recur.c
+++ b/src/recur.c
@@ -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 {