diff --git a/src/bin/e_config.c b/src/bin/e_config.c index ca410e507..6bde7802b 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -15,6 +15,7 @@ EAPI E_Config *e_config = NULL; static int _e_config_save_cb(void *data); static void _e_config_free(void); static int _e_config_cb_timer(void *data); +static void _e_config_eet_close_handle(Eet_File *ef, char *file); /* local subsystem globals */ static int _e_config_save_block = 0; @@ -1451,7 +1452,7 @@ e_config_profile_save(void) { ok = eet_write(ef, "config", _e_config_profile, strlen(_e_config_profile), 0); - eet_close(ef); + _e_config_eet_close_handle(ef, buf); } return ok; } @@ -1477,7 +1478,7 @@ e_config_domain_save(char *domain, E_Config_DD *edd, void *data) if (ef) { ok = eet_data_write(ef, edd, "config", data, 1); - eet_close(ef); + _e_config_eet_close_handle(ef, buf); } return ok; } @@ -1798,3 +1799,81 @@ _e_config_cb_timer(void *data) data); return 0; } + +static void +_e_config_eet_close_handle(Eet_File *ef, char *file) +{ + Eet_Error err; + char *erstr = NULL; + + err = eet_close(ef); + switch (err) + { + case EET_ERROR_WRITE_ERROR: + erstr = _("An error occured while saving Enlightenment's
" + "configuration to disk. The error could not be
" + "deterimined.
" + "
" + "The file where the error occured was:
" + "%s
" + "
" + "This file has been deleted to avoid corrupt data.
" + ); + break; + case EET_ERROR_WRITE_ERROR_FILE_TOO_BIG: + erstr = _("Enlightenment's configuration files are too big
" + "for the file system they are being saved to.
" + "This error is very strange as the files should
" + "be extremely small. Please check the settings
" + "for your home directory.
" + "
" + "The file where the error occured was:
" + "%s
" + "
" + "This file has been deleted to avoid corrupt data.
" + ); + break; + case EET_ERROR_WRITE_ERROR_IO_ERROR: + erstr = _("An output error occured when writing the configuration
" + "files for Enlightenment. Your disk is having troubles
" + "and possibly needs replacement.
" + "
" + "The file where the error occured was:
" + "%s
" + "
" + "This file has been deleted to avoid corrupt data.
" + ); + break; + case EET_ERROR_WRITE_ERROR_OUT_OF_SPACE: + erstr = _("Enlightenment cannot write its configuration file
" + "because it ran out of space to write the file.
" + "You have either run out of disk space or have
" + "gone over your quota limit.
" + "
" + "The file where the error occured was:
" + "%s
" + "
" + "This file has been deleted to avoid corrupt data.
" + ); + break; + case EET_ERROR_WRITE_ERROR_FILE_CLOSED: + erstr = _("Enlightenment unexpectedly had the configuration file
" + "it was writing closed on it. This is very unusual.
" + "
" + "The file where the error occured was:
" + "%s
" + "
" + "This file has been deleted to avoid corrupt data.
" + ); + break; + default: + break; + } + if (erstr) + { + /* delete any partially-written file */ + ecore_file_unlink(file); + e_util_dialog_show(_("Enlightenment Configration Write Problems"), + erstr, file); + } +}