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>
This commit is contained in:
committed by
Lukas Fleischer
parent
8b39637a62
commit
39ab4665e6
@@ -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") ||
|
||||
|
||||
Reference in New Issue
Block a user