app: gimp_get_temp_file() / gimp_temp_name() should create tmp/ if...

... it doesn't exist.
The tmp/ dir in the config folder should already be created by GIMP, but
just in case it is not there, try and create it, since all code calling
these assumes that it exists.
This commit is contained in:
Jehan 2018-04-23 00:35:01 +02:00
parent 08cc37271f
commit 33d9336083
1 changed files with 7 additions and 0 deletions

View File

@ -1183,6 +1183,13 @@ gimp_get_temp_file (Gimp *gimp,
dir = gimp_file_new_for_config_path (GIMP_GEGL_CONFIG (gimp->config)->temp_path,
NULL);
if (! g_file_query_exists (dir, NULL))
{
/* Try to make the temp directory if it doesn't exist.
* Ignore any error.
*/
g_file_make_directory_with_parents (dir, NULL, NULL);
}
file = g_file_get_child (dir, basename);
g_free (basename);
g_object_unref (dir);