From 52bfc54333d5795900970eeceee704fef4667873 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 25 Jun 2012 11:51:59 +0200 Subject: 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 --- src/recur.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/recur.c') 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 { -- cgit v1.2.3-54-g00ecf