[gimp] app: gimp_image_get_uri() -> gimp_image_get_uri_or_untitled()
- From: Martin Nordholts <martinn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: gimp_image_get_uri() -> gimp_image_get_uri_or_untitled()
- Date: Wed, 26 Jan 2011 07:18:40 +0000 (UTC)
commit ac773489e437fcdefd5b85903069441c881b8926
Author: Martin Nordholts <martinn src gnome org>
Date: Wed Jan 26 07:55:14 2011 +0100
app: gimp_image_get_uri() -> gimp_image_get_uri_or_untitled()
app/actions/debug-commands.c | 2 +-
app/actions/file-commands.c | 2 +-
app/actions/windows-actions.c | 2 +-
app/core/gimpimage.c | 14 +++++++++++---
app/core/gimpimage.h | 2 +-
app/display/gimpdisplayshell-title.c | 2 +-
app/file/file-open.c | 2 +-
app/gimpcore.def | 2 +-
app/widgets/gimpfiledialog.c | 4 ++--
9 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/app/actions/debug-commands.c b/app/actions/debug-commands.c
index 8e05274..c438d23 100644
--- a/app/actions/debug-commands.c
+++ b/app/actions/debug-commands.c
@@ -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),
diff --git a/app/actions/file-commands.c b/app/actions/file-commands.c
index c9e6545..022c16c 100644
--- a/app/actions/file-commands.c
+++ b/app/actions/file-commands.c
@@ -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);
diff --git a/app/actions/windows-actions.c b/app/actions/windows-actions.c
index e1df39d..63d6507 100644
--- a/app/actions/windows-actions.c
+++ b/app/actions/windows-actions.c
@@ -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);
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 011ac74..0961414 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -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);
}
diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h
index 6caf44a..9a26a54 100644
--- a/app/core/gimpimage.h
+++ b/app/core/gimpimage.h
@@ -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);
diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c
index dc6d6cb..5dfe162 100644
--- a/app/display/gimpdisplayshell-title.c
+++ b/app/display/gimpdisplayshell-title.c
@@ -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);
diff --git a/app/file/file-open.c b/app/file/file-open.c
index 2842e26..838fc92 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -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))
diff --git a/app/gimpcore.def b/app/gimpcore.def
index 128a1fc..e65bb1f 100644
--- a/app/gimpcore.def
+++ b/app/gimpcore.def
@@ -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
diff --git a/app/widgets/gimpfiledialog.c b/app/widgets/gimpfiledialog.c
index fae91d7..6f29168 100644
--- a/app/widgets/gimpfiledialog.c
+++ b/app/widgets/gimpfiledialog.c
@@ -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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]