create the swap directory if it doesn't exist. Will still fail if the

2005-03-23  Sven Neumann  <sven@gimp.org>

	* app/base/tile-swap.c (tile_swap_init): create the swap directory
	if it doesn't exist. Will still fail if the parent directory is not
	available. Still good enough to close bug #167506.

	* app/app_procs.c: tweaked error message.
This commit is contained in:
Sven Neumann 2005-03-22 23:20:56 +00:00 committed by Sven Neumann
parent 6b1d1888bc
commit 0ad939a46f
3 changed files with 21 additions and 5 deletions

View file

@ -1,7 +1,15 @@
2005-03-23 Sven Neumann <sven@gimp.org>
* app/base/tile-swap.c (tile_swap_init): create the swap directory
if it doesn't exist. Will still fail if the parent directory is not
available. Still good enough to close bug #167506.
* app/app_procs.c: tweaked error message.
2005-03-22 Sven Neumann <sven@gimp.org>
* plug-ins/common/colortoalpha.c: unset "Keep transparency", it is
not what the user wants if this plug-in is being used.
not what the user wants if this plug-in is being used (bug #151910).
2005-03-22 Sven Neumann <sven@gimp.org>

View file

@ -274,10 +274,10 @@ app_run (const gchar *full_prog_name,
/* display a warning when no test swap file could be generated */
if (! swap_is_ok)
g_message (_("Unable to open a test swap file. To avoid data loss "
"please check the location and permissions of the swap "
"directory defined in your Preferences "
"(currently \"%s\")."),
g_message (_("Unable to open a test swap file.\n\n"
"To avoid data loss, please check the location "
"and permissions of the swap directory defined in "
"your Preferences (currently \"%s\")."),
GIMP_BASE_CONFIG (gimp->config)->swap_path);
/* enable autosave late so we don't autosave when the

View file

@ -227,6 +227,14 @@ tile_swap_init (const gchar *path)
swappath = g_build_filename (swapdir, swapfile, NULL);
g_free (swapfile);
/* create the swap directory if it doesn't exist */
if (! g_file_test (swapdir, G_FILE_TEST_EXISTS))
g_mkdir (swapdir,
S_IRUSR | S_IXUSR | S_IWUSR |
S_IRGRP | S_IXGRP |
S_IROTH | S_IXOTH);
g_free (swapdir);
tile_swap_add (swappath, NULL, NULL);