diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2018-12-13 20:29:22 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2019-05-22 01:56:59 -0400 |
commit | 8dd694b56956a1c4ec3519743904222b465e10a5 (patch) | |
tree | a049852063d6fdece604a454e2218fae892f68d6 /src/day.c | |
parent | 06a4449afae29d4dd0e5d49249674511bb1f4489 (diff) | |
download | calcurse-8dd694b56956a1c4ec3519743904222b465e10a5.tar.gz calcurse-8dd694b56956a1c4ec3519743904222b465e10a5.zip |
Simplify day storage
The function day_process_storage() is a wrapper for day_store_items().
It has an unused second argument, and is only used twice to load the
selected day. It has been removed.
A new function, get_slctd_day(), is the equivalant of get_today() and
replaces the very awkwardly named ui_calendar_get_slctd_day_sec().
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/day.c')
-rw-r--r-- | src/day.c | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -369,28 +369,6 @@ day_store_items(time_t date, int include_captions) } /* - * Store the events and appointments for the selected day, and write - * those items in a pad. If selected day is null, then store items for current - * day. This is useful to speed up the appointment panel update. - */ -void day_process_storage(struct date *slctd_date, unsigned day_changed) -{ - struct date day; - - if (slctd_date) - day = *slctd_date; - else - ui_calendar_store_current_date(&day); - - /* Inits */ - if (apad.length != 0) - delwin(apad.ptrwin); - - /* Store the events and appointments (recursive and normal items). */ - day_store_items(date2sec(day, 0, 0), 1); -} - -/* * Print an item date in the appointment panel. */ void @@ -495,8 +473,7 @@ void day_popup_item(struct day_item *day) struct apoint apt_tmp; apt_tmp.start = day->start; apt_tmp.dur = day_item_get_duration(day); - apoint_sec2str(&apt_tmp, ui_calendar_get_slctd_day_sec(), - a_st, a_end); + apoint_sec2str(&apt_tmp, get_slctd_day(), a_st, a_end); item_in_popup(a_st, a_end, day_item_get_mesg(day), _("Appointment:")); |