Report errors when loading or saving the configuration (at least internally)
This commit is contained in:
parent
aac5ace676
commit
be60288340
18
src/editor.c
18
src/editor.c
@ -455,27 +455,31 @@ static gboolean _about_on_closex(gpointer data)
|
|||||||
|
|
||||||
|
|
||||||
/* editor_config_load */
|
/* editor_config_load */
|
||||||
void editor_config_load(Editor * editor)
|
int editor_config_load(Editor * editor)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
char * filename;
|
char * filename;
|
||||||
|
|
||||||
if((filename = _editor_config_filename()) == NULL)
|
if((filename = _editor_config_filename()) == NULL)
|
||||||
return;
|
return -1;
|
||||||
config_load(editor->config, filename); /* we can ignore errors */
|
ret = config_load(editor->config, filename);
|
||||||
free(filename);
|
free(filename);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* editor_config_save */
|
/* editor_config_save */
|
||||||
void editor_config_save(Editor * editor)
|
int editor_config_save(Editor * editor)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
char * filename;
|
char * filename;
|
||||||
|
|
||||||
if((filename = _editor_config_filename()) == NULL)
|
if((filename = _editor_config_filename()) == NULL)
|
||||||
return;
|
return -1;
|
||||||
if(config_save(editor->config, filename) != 0)
|
if((ret = config_save(editor->config, filename)) != 0)
|
||||||
editor_error(editor, _("Could not save configuration"), 0);
|
editor_error(editor, _("Could not save configuration"), 1);
|
||||||
free(filename);
|
free(filename);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user