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 <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-06-25 22:30:20 +02:00
parent b97c2a09cf
commit 0504875219
4 changed files with 19 additions and 24 deletions

View File

@@ -1154,3 +1154,18 @@ void day_pipe_item(void)
}
wins_unprepare_external();
}
/* Switch notification state for an item. */
void day_item_switch_notify(void)
{
struct day_item *p = day_get_item(apoint_hilt());
switch (p->type) {
case RECUR_APPT:
recur_apoint_switch_notify(p->item.rapt);
break;
case APPT:
apoint_switch_notify(p->item.apt);
break;
}
}