mirror of https://github.com/GNOME/gimp.git
fixed error code and improved error messages.
2002-05-27 Sven Neumann <sven@gimp.org> * app/config/gimpconfig.c (gimp_config_serialize): fixed error code and improved error messages.
This commit is contained in:
parent
799c772fe1
commit
93799415c8
|
@ -1,3 +1,8 @@
|
||||||
|
2002-05-27 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/config/gimpconfig.c (gimp_config_serialize): fixed error code
|
||||||
|
and improved error messages.
|
||||||
|
|
||||||
2002-05-27 Michael Natterer <mitch@gimp.org>
|
2002-05-27 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* libgimpwidgets/gimpsizeentry.c (gimp_size_entry_attach_label):
|
* libgimpwidgets/gimpsizeentry.c (gimp_size_entry_attach_label):
|
||||||
|
|
|
@ -213,7 +213,7 @@ gimp_config_serialize (GObject *object,
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_OPEN,
|
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
|
||||||
_("Failed to create temporary file for '%s': %s"),
|
_("Failed to create temporary file for '%s': %s"),
|
||||||
filename, g_strerror (errno));
|
filename, g_strerror (errno));
|
||||||
g_free (tmpname);
|
g_free (tmpname);
|
||||||
|
@ -234,10 +234,22 @@ gimp_config_serialize (GObject *object,
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
gchar *msg;
|
||||||
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
|
|
||||||
_("Error when writing to file '%s': %s"),
|
if (g_file_test (filename, G_FILE_TEST_EXIST))
|
||||||
tmpname, g_strerror (errno));
|
{
|
||||||
|
msg = g_strdup_printf (_("Error when writing to temporary file for '%s': %s\n"
|
||||||
|
"The original file has not been touched."),
|
||||||
|
filename, g_strerror (errno));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg = g_strdup_printf (_("Error when writing to temporary file for '%s': %s\n"
|
||||||
|
"No file has been created."),
|
||||||
|
filename, g_strerror (errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, msg);
|
||||||
|
|
||||||
unlink (tmpname);
|
unlink (tmpname);
|
||||||
}
|
}
|
||||||
|
@ -247,7 +259,7 @@ gimp_config_serialize (GObject *object,
|
||||||
if (success && rename (tmpname, filename) == -1)
|
if (success && rename (tmpname, filename) == -1)
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_OPEN,
|
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
|
||||||
_("Failed to create file '%s': %s"),
|
_("Failed to create file '%s': %s"),
|
||||||
filename, g_strerror (errno));
|
filename, g_strerror (errno));
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ gimp_config_serialize (GObject *object,
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_OPEN,
|
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
|
||||||
_("Failed to create temporary file for '%s': %s"),
|
_("Failed to create temporary file for '%s': %s"),
|
||||||
filename, g_strerror (errno));
|
filename, g_strerror (errno));
|
||||||
g_free (tmpname);
|
g_free (tmpname);
|
||||||
|
@ -234,10 +234,22 @@ gimp_config_serialize (GObject *object,
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
gchar *msg;
|
||||||
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
|
|
||||||
_("Error when writing to file '%s': %s"),
|
if (g_file_test (filename, G_FILE_TEST_EXIST))
|
||||||
tmpname, g_strerror (errno));
|
{
|
||||||
|
msg = g_strdup_printf (_("Error when writing to temporary file for '%s': %s\n"
|
||||||
|
"The original file has not been touched."),
|
||||||
|
filename, g_strerror (errno));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg = g_strdup_printf (_("Error when writing to temporary file for '%s': %s\n"
|
||||||
|
"No file has been created."),
|
||||||
|
filename, g_strerror (errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE, msg);
|
||||||
|
|
||||||
unlink (tmpname);
|
unlink (tmpname);
|
||||||
}
|
}
|
||||||
|
@ -247,7 +259,7 @@ gimp_config_serialize (GObject *object,
|
||||||
if (success && rename (tmpname, filename) == -1)
|
if (success && rename (tmpname, filename) == -1)
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_OPEN,
|
GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
|
||||||
_("Failed to create file '%s': %s"),
|
_("Failed to create file '%s': %s"),
|
||||||
filename, g_strerror (errno));
|
filename, g_strerror (errno));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue