Add io_load_data() wrapper
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
61e2206dca
commit
8553a99161
15
src/args.c
15
src/args.c
@ -747,8 +747,7 @@ int parse_args(int argc, char **argv)
|
|||||||
io_check_file(path_conf);
|
io_check_file(path_conf);
|
||||||
vars_init();
|
vars_init();
|
||||||
config_load(); /* To get output date format. */
|
config_load(); /* To get output date format. */
|
||||||
io_load_app(&filter);
|
io_load_data(&filter);
|
||||||
io_load_todo(&filter);
|
|
||||||
io_save_todo(NULL);
|
io_save_todo(NULL);
|
||||||
io_save_apts(NULL);
|
io_save_apts(NULL);
|
||||||
} else if (query) {
|
} else if (query) {
|
||||||
@ -757,8 +756,7 @@ int parse_args(int argc, char **argv)
|
|||||||
io_check_file(path_conf);
|
io_check_file(path_conf);
|
||||||
vars_init();
|
vars_init();
|
||||||
config_load(); /* To get output date format. */
|
config_load(); /* To get output date format. */
|
||||||
io_load_app(&filter);
|
io_load_data(&filter);
|
||||||
io_load_todo(&filter);
|
|
||||||
int add_line = todo_arg(fmt_todo, &limit, &filter);
|
int add_line = todo_arg(fmt_todo, &limit, &filter);
|
||||||
date_arg_from_to(from, to, add_line, fmt_apt, fmt_rapt, fmt_ev,
|
date_arg_from_to(from, to, add_line, fmt_apt, fmt_rapt, fmt_ev,
|
||||||
fmt_rev, &limit);
|
fmt_rev, &limit);
|
||||||
@ -769,24 +767,21 @@ int parse_args(int argc, char **argv)
|
|||||||
} else if (gc) {
|
} else if (gc) {
|
||||||
io_check_file(path_apts);
|
io_check_file(path_apts);
|
||||||
io_check_file(path_todo);
|
io_check_file(path_todo);
|
||||||
io_load_app(NULL);
|
io_load_data(NULL);
|
||||||
io_load_todo(NULL);
|
|
||||||
note_gc();
|
note_gc();
|
||||||
} else if (import) {
|
} else if (import) {
|
||||||
io_check_file(path_apts);
|
io_check_file(path_apts);
|
||||||
io_check_file(path_todo);
|
io_check_file(path_todo);
|
||||||
/* Get default pager in case we need to show a log file. */
|
/* Get default pager in case we need to show a log file. */
|
||||||
vars_init();
|
vars_init();
|
||||||
io_load_app(NULL);
|
io_load_data(NULL);
|
||||||
io_load_todo(NULL);
|
|
||||||
io_import_data(IO_IMPORT_ICAL, ifile);
|
io_import_data(IO_IMPORT_ICAL, ifile);
|
||||||
io_save_apts(path_apts);
|
io_save_apts(path_apts);
|
||||||
io_save_todo(path_todo);
|
io_save_todo(path_todo);
|
||||||
} else if (export) {
|
} else if (export) {
|
||||||
io_check_file(path_apts);
|
io_check_file(path_apts);
|
||||||
io_check_file(path_todo);
|
io_check_file(path_todo);
|
||||||
io_load_app(&filter);
|
io_load_data(&filter);
|
||||||
io_load_todo(&filter);
|
|
||||||
io_export_data(xfmt);
|
io_export_data(xfmt);
|
||||||
} else {
|
} else {
|
||||||
/* interactive mode */
|
/* interactive mode */
|
||||||
|
@ -332,8 +332,7 @@ static inline void key_generic_reload(void)
|
|||||||
recur_event_llist_init();
|
recur_event_llist_init();
|
||||||
todo_init_list();
|
todo_init_list();
|
||||||
|
|
||||||
io_load_todo(NULL);
|
io_load_data(NULL);
|
||||||
io_load_app(NULL);
|
|
||||||
io_unset_modified();
|
io_unset_modified();
|
||||||
ui_todo_load_items();
|
ui_todo_load_items();
|
||||||
ui_todo_sel_reset();
|
ui_todo_sel_reset();
|
||||||
@ -683,8 +682,7 @@ int main(int argc, char **argv)
|
|||||||
config_load();
|
config_load();
|
||||||
wins_erase_status_bar();
|
wins_erase_status_bar();
|
||||||
io_load_keys(conf.pager);
|
io_load_keys(conf.pager);
|
||||||
io_load_todo(NULL);
|
io_load_data(NULL);
|
||||||
io_load_app(NULL);
|
|
||||||
io_unset_modified();
|
io_unset_modified();
|
||||||
wins_slctd_set(conf.default_panel);
|
wins_slctd_set(conf.default_panel);
|
||||||
wins_resize();
|
wins_resize();
|
||||||
|
@ -796,6 +796,7 @@ unsigned io_save_keys(void);
|
|||||||
void io_save_cal(enum save_display);
|
void io_save_cal(enum save_display);
|
||||||
void io_load_app(struct item_filter *);
|
void io_load_app(struct item_filter *);
|
||||||
void io_load_todo(struct item_filter *);
|
void io_load_todo(struct item_filter *);
|
||||||
|
void io_load_data(struct item_filter *);
|
||||||
void io_load_keys(const char *);
|
void io_load_keys(const char *);
|
||||||
int io_check_dir(const char *);
|
int io_check_dir(const char *);
|
||||||
unsigned io_dir_exists(const char *);
|
unsigned io_dir_exists(const char *);
|
||||||
|
7
src/io.c
7
src/io.c
@ -686,6 +686,13 @@ void io_load_todo(struct item_filter *filter)
|
|||||||
file_close(data_file, __FILE_POS__);
|
file_close(data_file, __FILE_POS__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Load appointments and todo items */
|
||||||
|
void io_load_data(struct item_filter *filter)
|
||||||
|
{
|
||||||
|
io_load_app(filter);
|
||||||
|
io_load_todo(filter);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
load_keys_ht_getkey(struct ht_keybindings_s *data, const char **key,
|
load_keys_ht_getkey(struct ht_keybindings_s *data, const char **key,
|
||||||
int *len)
|
int *len)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user