From 0504875219bdc4c017938bdccf564d9a452afcc6 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 25 Jun 2012 22:30:20 +0200 Subject: Simplify apoint_switch_notify() Pull out code from apoint_switch_notify() -- especially the fallback routine that calls recur_apoint_switch_notify() if the currently selected item is a recurrent item -- and move it to a wrapper function day_item_switch_notify(). Signed-off-by: Lukas Fleischer --- src/apoint.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'src/apoint.c') diff --git a/src/apoint.c b/src/apoint.c index 16efd25..d6def9d 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -547,34 +547,13 @@ struct notify_app *apoint_check_next(struct notify_app *app, long start) /* * Switch notification state. */ -void apoint_switch_notify(void) +void apoint_switch_notify(struct apoint *apt) { - struct day_item *p; - long date; - int apoint_nb = 0, need_chk_notify; - - p = day_get_item(hilt); - if (p->type != APPT && p->type != RECUR_APPT) - return; - - date = calendar_get_slctd_day_sec(); - - if (p->type == RECUR_APPT) { - recur_apoint_switch_notify(p->item.rapt); - return; - } else if (p->type == APPT) - apoint_nb = day_item_nb(date, hilt, APPT); - - need_chk_notify = 0; LLIST_TS_LOCK(&alist_p); - struct apoint *apt = apoint_get(date, apoint_nb); - apt->state ^= APOINT_NOTIFY; if (notify_bar()) notify_check_added(apt->mesg, apt->start, apt->state); - if (need_chk_notify) - notify_check_next_app(0); LLIST_TS_UNLOCK(&alist_p); } -- cgit v1.2.3-54-g00ecf