From 8dd694b56956a1c4ec3519743904222b465e10a5 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Thu, 13 Dec 2018 20:29:22 +0100 Subject: 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 --- src/day.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'src/day.c') diff --git a/src/day.c b/src/day.c index 96b863a..c4d1cac 100644 --- a/src/day.c +++ b/src/day.c @@ -368,28 +368,6 @@ day_store_items(time_t date, int include_captions) day_items_nb = events + apts; } -/* - * 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. */ @@ -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:")); -- cgit v1.2.3-54-g00ecf