diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2018-08-23 20:45:38 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2018-10-21 20:01:34 +0200 |
commit | 5ad0019b2326e4012299e36682669ca767f39cd4 (patch) | |
tree | 08ebd6a2b9a4a7ee2826d89bb973dea8c11181a2 /src/args.c | |
parent | ab0fe682255f01e75b70a6ee3e95795020be8dd7 (diff) | |
download | calcurse-5ad0019b2326e4012299e36682669ca767f39cd4.tar.gz calcurse-5ad0019b2326e4012299e36682669ca767f39cd4.zip |
Only reload if data files were changed (replacement)
This is a replacement for commits 57dd3d6 and 912124b.
The idea is to move the check for modified files and the list initialization
into io_load_data(), and let io_load_data() decide what to load. A new
argument is used to force a load.
The return code from new_data() (the renamed version of
io_check_data_files_modified()) tells which files have changed.
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/args.c')
-rw-r--r-- | src/args.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -738,7 +738,7 @@ int parse_args(int argc, char **argv) io_check_file(path_todo); io_check_file(path_conf); config_load(); /* To get output date format. */ - io_load_data(&filter); + io_load_data(&filter, FORCE); if (grep_filter) { io_save_todo(path_todo); io_save_apts(path_apts); @@ -760,7 +760,7 @@ int parse_args(int argc, char **argv) io_check_file(path_todo); io_check_file(path_conf); config_load(); /* To get output date format. */ - io_load_data(&filter); + io_load_data(&filter, FORCE); /* Use default values for non-specified format strings. */ fmt_apt = fmt_apt ? fmt_apt : " - %S -> %E\n\t%m\n"; @@ -779,13 +779,12 @@ int parse_args(int argc, char **argv) } else if (gc) { io_check_file(path_apts); io_check_file(path_todo); - io_load_data(NULL); + io_load_data(NULL, FORCE); note_gc(); } else if (import) { io_check_file(path_apts); io_check_file(path_todo); - /* Get default pager in case we need to show a log file. */ - io_load_data(NULL); + io_load_data(NULL, FORCE); if (dump_imported) { /* * Use default values for non-specified format strings. @@ -809,7 +808,7 @@ int parse_args(int argc, char **argv) } else if (export) { io_check_file(path_apts); io_check_file(path_todo); - io_load_data(&filter); + io_load_data(&filter, FORCE); io_export_data(xfmt, export_uid); } else if (daemon) { notify_init_vars(); |