Commit fea22c34 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 706361 - Printer queue dosn't show the filename of the printing image

Change the gimp-image-get-name procedure to return the same string
as shown in the image title, and mention in its API docs that this
string is meant for annotating UI elements only.
parent 4321cda3
......@@ -2439,11 +2439,7 @@ image_get_name_invoker (GimpProcedure *procedure,
if (success)
{
/* XXX do we really want to return this, or the name as in the title? */
const gchar *uri = gimp_image_get_uri_or_untitled (image);
name = file_utils_uri_display_basename (uri);
name = g_strdup (gimp_image_get_display_name (image));
}
return_vals = gimp_procedure_get_return_values (procedure, success,
......@@ -5327,7 +5323,7 @@ register_image_procs (GimpPDB *pdb)
gimp_procedure_set_static_strings (procedure,
"gimp-image-get-name",
"Returns the specified image's name.",
"This procedure returns the image's name. If the image has a filename or an URI, then this is the base name (the last component of the path). Otherwise it is the translated string \"Untitled\".",
"This procedure returns the image's name. If the image has a filename or an URI, then the returned name contains the filename's or URI's base name (the last component of the path). Otherwise it is the translated string \"Untitled\". The returned name is formatted like the image name in the image window title, it may contain '[]', '(imported)' etc. and should only be used to label user interface elements. Never use it to construct filenames.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
......
......@@ -2587,8 +2587,12 @@ gimp_image_get_exported_uri (gint32 image_ID)
* Returns the specified image's name.
*
* This procedure returns the image's name. If the image has a filename
* or an URI, then this is the base name (the last component of the
* path). Otherwise it is the translated string \"Untitled\".
* or an URI, then the returned name contains the filename's or URI's
* base name (the last component of the path). Otherwise it is the
* translated string \"Untitled\". The returned name is formatted like
* the image name in the image window title, it may contain '[]',
* '(imported)' etc. and should only be used to label user interface
* elements. Never use it to construct filenames.
*
* Returns: The name. The returned value must be freed with g_free().
**/
......
......@@ -2433,9 +2433,13 @@ CODE
sub image_get_name {
$blurb = "Returns the specified image's name.";
$help = <<'HELP';
This procedure returns the image's name. If the image has a filename or
an URI, then this is the base name (the last component of the path).
Otherwise it is the translated string "Untitled".
This procedure returns the image's name. If the image has a filename
or an URI, then the returned name contains the filename's or URI's
base name (the last component of the path). Otherwise it is the
translated string "Untitled". The returned name is formatted like the
image name in the image window title, it may contain '[]',
'(imported)' etc. and should only be used to label user interface
elements. Never use it to construct filenames.
HELP
&std_pdb_misc;
......@@ -2453,11 +2457,7 @@ HELP
%invoke = (
code => <<'CODE'
{
/* XXX do we really want to return this, or the name as in the title? */
const gchar *uri = gimp_image_get_uri_or_untitled (image);
name = file_utils_uri_display_basename (uri);
name = g_strdup (gimp_image_get_display_name (image));
}
CODE
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment