aboutsummaryrefslogtreecommitdiffstats
path: root/src/day.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-06-25 22:30:20 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-06-30 14:34:35 +0200
commit0504875219bdc4c017938bdccf564d9a452afcc6 (patch)
tree85d5a82bcb7b89cffcb9daca017107108c2f9471 /src/day.c
parentb97c2a09cffa9963fd0f5086e5da6031b1d48342 (diff)
downloadcalcurse-0504875219bdc4c017938bdccf564d9a452afcc6.tar.gz
calcurse-0504875219bdc4c017938bdccf564d9a452afcc6.zip
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>
Diffstat (limited to 'src/day.c')
-rw-r--r--src/day.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/day.c b/src/day.c
index 23aa757..bc40d77 100644
--- a/src/day.c
+++ b/src/day.c
@@ -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;
+ }
+}