Commit ac773489 authored by Martin Nordholts's avatar Martin Nordholts

app: gimp_image_get_uri() -> gimp_image_get_uri_or_untitled()

parent 0cbb8ac0
......@@ -351,7 +351,7 @@ debug_show_image_graph (GimpImage *source_image)
/* Create a new image of the result */
tiles = gimp_buffer_to_tiles (buffer);
new_name = g_strdup_printf ("%s GEGL graph",
file_utils_uri_display_name (gimp_image_get_uri (source_image)));
file_utils_uri_display_name (gimp_image_get_uri_or_untitled (source_image)));
new_image = gimp_create_image (gimp,
tile_manager_width (tiles),
tile_manager_height (tiles),
......
......@@ -413,7 +413,7 @@ file_revert_cmd_callback (GtkAction *action,
if (! source)
basename = file_utils_uri_display_basename (uri);
else
basename = g_strdup (gimp_image_get_uri (image));
basename = g_strdup (gimp_image_get_uri_or_untitled (image));
filename = file_utils_uri_display_name (uri);
......
......@@ -283,7 +283,7 @@ windows_actions_image_notify (GimpDisplay *display,
gchar *escaped;
gchar *title;
uri = gimp_image_get_uri (image);
uri = gimp_image_get_uri_or_untitled (image);
filename = file_utils_uri_display_name (uri);
basename = file_utils_uri_display_basename (uri);
......
......@@ -1150,7 +1150,7 @@ gimp_image_get_description (GimpViewable *viewable,
if (tooltip)
{
*tooltip = file_utils_uri_display_name (gimp_image_get_uri (image));
*tooltip = file_utils_uri_display_name (gimp_image_get_uri_or_untitled (image));
}
return g_strdup_printf ("%s-%d",
......@@ -1517,8 +1517,16 @@ gimp_image_take_uri (GimpImage *image,
gimp_object_take_name (GIMP_OBJECT (image), uri);
}
/**
* gimp_image_get_uri_or_untitled:
* @image: A #GimpImage.
*
* Get the URI of the XCF image, or "Untitled" if there is no URI.
*
* Returns: The URI, or "Untitled".
**/
const gchar *
gimp_image_get_uri (const GimpImage *image)
gimp_image_get_uri_or_untitled (const GimpImage *image)
{
const gchar *uri;
......@@ -1574,7 +1582,7 @@ gimp_image_get_display_name (GimpImage *image)
if (! private->display_name)
{
const gchar *uri = gimp_image_get_uri (image);
const gchar *uri = gimp_image_get_uri_or_untitled (image);
private->display_name = file_utils_uri_display_basename (uri);
}
......
......@@ -172,7 +172,7 @@ GimpImage * gimp_image_get_by_ID (Gimp *gimp,
void gimp_image_set_uri (GimpImage *image,
const gchar *uri);
const gchar * gimp_image_get_uri (const GimpImage *image);
const gchar * gimp_image_get_uri_or_untitled (const GimpImage *image);
void gimp_image_set_filename (GimpImage *image,
const gchar *filename);
......
......@@ -221,7 +221,7 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
case 'F': /* full filename */
{
gchar *filename;
const gchar *uri = gimp_image_get_uri (image);
const gchar *uri = gimp_image_get_uri_or_untitled (image);
filename = file_utils_uri_display_name (uri);
......
......@@ -415,7 +415,7 @@ file_open_with_proc_and_display (Gimp *gimp,
/* can only create a thumbnail if the passed uri and the
* resulting image's uri match.
*/
if (strcmp (uri, gimp_image_get_uri (image)) == 0)
if (strcmp (uri, gimp_image_get_uri_or_untitled (image)) == 0)
{
/* no need to save a thumbnail if there's a good one already */
if (! gimp_imagefile_check_thumbnail (imagefile))
......
......@@ -302,7 +302,7 @@ EXPORTS
gimp_image_get_quick_mask_color
gimp_image_get_quick_mask_state
gimp_image_get_type
gimp_image_get_uri
gimp_image_get_uri_or_untitled
gimp_image_get_vectors
gimp_image_get_vectors_index
gimp_image_get_width
......
......@@ -566,7 +566,7 @@ gimp_file_dialog_set_save_image (GimpFileDialog *dialog,
GIMP_FILE_IMPORT_SOURCE_URI_KEY);
if (! name_uri)
name_uri = gimp_image_get_uri (image); /* Untitled */
name_uri = gimp_image_get_uri_or_untitled (image);
/* Priority of default type/extension for Save:
......@@ -637,7 +637,7 @@ gimp_file_dialog_set_save_image (GimpFileDialog *dialog,
GIMP_FILE_IMPORT_SOURCE_URI_KEY);
if (! name_uri)
name_uri = gimp_image_get_uri (image); /* Untitled */
name_uri = gimp_image_get_uri_or_untitled (image);
/* Priority of default type/extension for Export:
......
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