mirror of https://github.com/GNOME/gimp.git
handle a NULL extension and create a filename without file extension.
2007-09-30 Sven Neumann <sven@gimp.org> * app/core/gimp-utils.c (gimp_get_temp_filename): handle a NULL extension and create a filename without file extension. * tools/pdbgen/pdb/fileops.pdb * app/pdb/fileops_cmds.c: allow NULL to be passed as extension parameter to gimp_temp_name(). svn path=/trunk/; revision=23697
This commit is contained in:
parent
17dd822af6
commit
4b52112b6a
|
@ -1,3 +1,12 @@
|
||||||
|
2007-09-30 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/core/gimp-utils.c (gimp_get_temp_filename): handle a NULL
|
||||||
|
extension and create a filename without file extension.
|
||||||
|
|
||||||
|
* tools/pdbgen/pdb/fileops.pdb
|
||||||
|
* app/pdb/fileops_cmds.c: allow NULL to be passed as extension
|
||||||
|
parameter to gimp_temp_name().
|
||||||
|
|
||||||
2007-09-30 Sven Neumann <sven@gimp.org>
|
2007-09-30 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/actions/templates-commands.c: reverted last change. We would
|
* app/actions/templates-commands.c: reverted last change. We would
|
||||||
|
|
|
@ -493,12 +493,14 @@ gimp_get_temp_filename (Gimp *gimp,
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||||
g_return_val_if_fail (extension != NULL, NULL);
|
|
||||||
|
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
pid = getpid ();
|
pid = getpid ();
|
||||||
|
|
||||||
basename = g_strdup_printf ("gimp-temp-%d%d.%s", pid, id++, extension);
|
if (extension)
|
||||||
|
basename = g_strdup_printf ("gimp-temp-%d%d.%s", pid, id++, extension);
|
||||||
|
else
|
||||||
|
basename = g_strdup_printf ("gimp-temp-%d%d", pid, id++);
|
||||||
|
|
||||||
path = gimp_config_path_expand (GIMP_BASE_CONFIG (gimp->config)->temp_path,
|
path = gimp_config_path_expand (GIMP_BASE_CONFIG (gimp->config)->temp_path,
|
||||||
TRUE, NULL);
|
TRUE, NULL);
|
||||||
|
|
|
@ -804,7 +804,7 @@ register_fileops_procs (GimpPDB *pdb)
|
||||||
gimp_param_spec_string ("extension",
|
gimp_param_spec_string ("extension",
|
||||||
"extension",
|
"extension",
|
||||||
"The extension the file will have",
|
"The extension the file will have",
|
||||||
TRUE, FALSE, FALSE,
|
TRUE, TRUE, FALSE,
|
||||||
NULL,
|
NULL,
|
||||||
GIMP_PARAM_READWRITE));
|
GIMP_PARAM_READWRITE));
|
||||||
gimp_procedure_add_return_value (procedure,
|
gimp_procedure_add_return_value (procedure,
|
||||||
|
|
|
@ -403,7 +403,8 @@ HELP
|
||||||
&josh_pdb_misc('1997');
|
&josh_pdb_misc('1997');
|
||||||
|
|
||||||
@inargs = (
|
@inargs = (
|
||||||
{ name => 'extension', type => 'string', allow_non_utf8 => 1,
|
{ name => 'extension', type => 'string',
|
||||||
|
allow_non_utf8 => 1, null_ok => 1,
|
||||||
desc => 'The extension the file will have' }
|
desc => 'The extension the file will have' }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue