aboutsummaryrefslogtreecommitdiffstats
path: root/src/calcurse.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2018-08-28 21:11:06 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-10-21 20:01:34 +0200
commit39ab4665e6bb13372da24b86f32cc50fff8c0e9f (patch)
treeddb070a2d19be7c141b4a3c56fa7bebc41320513 /src/calcurse.c
parent8b39637a628cba915e81f836aad74ec05bf0c285 (diff)
downloadcalcurse-39ab4665e6bb13372da24b86f32cc50fff8c0e9f.tar.gz
calcurse-39ab4665e6bb13372da24b86f32cc50fff8c0e9f.zip
Data save and removal of the progress bar
The function io_save_cal() saves apts, todos, configuration data and key bindings. The configuration and key files do not belong with the two data files, but the progress bar function assumes that all four files are saved in a fixed sequence. Since it is used nowhere else and contains unused parts, the function has been removed. A return code for file access error is introduced, and the EXIT macro moved to the command level in calcurse.c. Save of configuration and key data were already moved to the configuration menu in commit 0124618, A save refinement: no action if everything is unchanged. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/calcurse.c')
-rw-r--r--src/calcurse.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/calcurse.c b/src/calcurse.c
index 4560e5c..57dce89 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -274,7 +274,7 @@ static inline void key_generic_save(void)
char *msg = NULL;
int ret;
- ret = io_save_cal(IO_SAVE_DISPLAY_BAR);
+ ret = io_save_cal();
if (ret == IO_SAVE_RELOAD) {
ui_todo_load_items();
@@ -297,6 +297,8 @@ static inline void key_generic_save(void)
case IO_SAVE_NOOP:
msg = _("Data were already saved");
break;
+ case IO_SAVE_ERROR:
+ EXIT(_("Cannot open data file"));
}
status_mesg(msg, "");
}
@@ -503,7 +505,7 @@ static inline void key_generic_scroll_down(void)
static inline void key_generic_quit(void)
{
if (conf.auto_save)
- io_save_cal(IO_SAVE_DISPLAY_BAR);
+ io_save_cal();
if (conf.auto_gc)
note_gc();
@@ -538,7 +540,7 @@ static inline void key_generic_cmd(void)
if (!strcmp(cmd_name, "write") || !strcmp(cmd_name, "w") ||
!strcmp(cmd_name, "wq")) {
- io_save_cal(IO_SAVE_DISPLAY_BAR);
+ io_save_cal();
valid = 1;
}
if (!strcmp(cmd_name, "quit") || !strcmp(cmd_name, "q") ||