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>
This commit is contained in:
Lars Henriksen
2018-12-13 20:29:22 +01:00
committed by Lukas Fleischer
parent 06a4449afa
commit 8dd694b569
6 changed files with 15 additions and 44 deletions

View File

@@ -48,18 +48,13 @@ int count, reg;
*/
static void do_storage(int day_changed)
{
/* * Save the selected item before rebuilding the day vector. */
struct day_item *day = ui_day_selitem();
union aptev_ptr item;
if (day) {
/*
* day_process_storage() rebuilds the vector of day items, so
* we need to save the reference to the actual item here.
*/
if (day)
item = day->item;
}
day_process_storage(ui_calendar_get_slctd_day(), day_changed);
day_store_items(get_slctd_day(), 1);
ui_day_load_items();
if (day_changed)