summaryrefslogtreecommitdiff
path: root/src/day.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-07-07 11:55:10 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-07-07 21:35:02 +0200
commit7fb25a84d427f4a3cb79ea02908daf9ce8ba07ca (patch)
treecb24b54351955c1d354095023534d8b51d8f9cec /src/day.c
parent69345edd77b3ff98a99b36de8063f9e5febad3eb (diff)
downloadcalcurse-7fb25a84d427f4a3cb79ea02908daf9ce8ba07ca.zip
Refactor note removal
Remove the note removal code from *_delete()/*_erase() and create a new wrapper function called day_item_erase_note() that is be used to drop the note being associated to an item. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/day.c')
-rw-r--r--src/day.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/day.c b/src/day.c
index 26ae3e0..10caa05 100644
--- a/src/day.c
+++ b/src/day.c
@@ -123,6 +123,25 @@ char *day_item_get_note(struct day_item *day)
}
}
+/* Get the note attached to an item. */
+void day_item_erase_note(struct day_item *day)
+{
+ switch (day->type) {
+ case APPT:
+ erase_note(&day->item.apt->note);
+ break;
+ case EVNT:
+ erase_note(&day->item.ev->note);
+ break;
+ case RECUR_APPT:
+ erase_note(&day->item.rapt->note);
+ break;
+ case RECUR_EVNT:
+ erase_note(&day->item.rev->note);
+ break;
+ }
+}
+
/* Get the duration of an item. */
long day_item_get_duration(struct day_item *day)
{