Commit 1e6a94e6 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/core/gimpgradient-load.c app/core/gimppalette.c app/core/gimppattern.c

2005-02-20  Sven Neumann  <sven@gimp.org>

	* app/core/gimpgradient-load.c
	* app/core/gimppalette.c
	* app/core/gimppattern.c
	* app/plug-in/plug-in.c
	* libgimpbase/gimputils.c
	* libgimpmodule/gimpmodule.c
	* libgimpwidgets/gimppatheditor.c
	* tools/pdbgen/pdb/image.pdb: use g_filename_display_name() or
	g_filename_display_basename() where appropriate.

	* app/pdb/image_cmds.c: regenerated.
parent 7827c1dd
......@@ -95,16 +95,10 @@ gimp_gradient_load (const gchar *filename,
}
else /* old gradient format */
{
gchar *basename;
gchar *utf8;
basename = g_path_get_basename (filename);
utf8 = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
g_free (basename);
gchar *name = g_filename_display_basename (filename);
gimp_object_set_name (GIMP_OBJECT (gradient), utf8);
g_free (utf8);
gimp_object_set_name (GIMP_OBJECT (gradient), name);
g_free (name);
}
num_segments = atoi (line);
......
......@@ -461,16 +461,10 @@ gimp_palette_load (const gchar *filename,
}
else /* old palette format */
{
gchar *basename;
gchar *utf8;
basename = g_path_get_basename (filename);
utf8 = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
g_free (basename);
gchar *name = g_filename_display_basename (filename);
gimp_object_set_name (GIMP_OBJECT (palette), utf8);
g_free (utf8);
gimp_object_set_name (GIMP_OBJECT (palette), name);
g_free (name);
}
while (! feof (file))
......
......@@ -461,16 +461,10 @@ gimp_palette_load (const gchar *filename,
}
else /* old palette format */
{
gchar *basename;
gchar *utf8;
basename = g_path_get_basename (filename);
utf8 = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
g_free (basename);
gchar *name = g_filename_display_basename (filename);
gimp_object_set_name (GIMP_OBJECT (palette), utf8);
g_free (utf8);
gimp_object_set_name (GIMP_OBJECT (palette), name);
g_free (name);
}
while (! feof (file))
......
......@@ -461,16 +461,10 @@ gimp_palette_load (const gchar *filename,
}
else /* old palette format */
{
gchar *basename;
gchar *utf8;
basename = g_path_get_basename (filename);
utf8 = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
g_free (basename);
gchar *name = g_filename_display_basename (filename);
gimp_object_set_name (GIMP_OBJECT (palette), utf8);
g_free (utf8);
gimp_object_set_name (GIMP_OBJECT (palette), name);
g_free (name);
}
while (! feof (file))
......
......@@ -469,13 +469,7 @@ gimp_pattern_load_pixbuf (const gchar *filename,
name = g_strdup (gdk_pixbuf_get_option (pixbuf, "tEXt::Comment"));
if (! name)
{
gchar *basename = g_path_get_basename (filename);
name = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
g_free (basename);
}
name = g_filename_display_basename (filename);
pattern = g_object_new (GIMP_TYPE_PATTERN,
"name", name,
......
......@@ -469,13 +469,7 @@ gimp_pattern_load_pixbuf (const gchar *filename,
name = g_strdup (gdk_pixbuf_get_option (pixbuf, "tEXt::Comment"));
if (! name)
{
gchar *basename = g_path_get_basename (filename);
name = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
g_free (basename);
}
name = g_filename_display_basename (filename);
pattern = g_object_new (GIMP_TYPE_PATTERN,
"name", name,
......
......@@ -3747,18 +3747,9 @@ image_get_name_invoker (Gimp *gimp,
filename = gimp_image_get_filename (gimage);
if (filename)
{
gchar *basename = g_path_get_basename (filename);
name = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
g_free (basename);
if (! name)
name = g_strdup (_("(invalid UTF-8 string)"));
}
name = g_filename_display_basename (filename);
else
{
name = g_strdup (_("Untitled"));
}
name = g_strdup (_("Untitled"));
}
return_args = procedural_db_return_args (&image_get_name_proc, success);
......
......@@ -978,7 +978,7 @@ plug_in_get_undo_desc (PlugIn *plug_in)
}
if (! undo_desc)
undo_desc = g_filename_to_utf8 (plug_in->name, -1, NULL, NULL, NULL);
undo_desc = g_filename_display_name (plug_in->name);
return undo_desc;
}
......@@ -978,7 +978,7 @@ plug_in_get_undo_desc (PlugIn *plug_in)
}
if (! undo_desc)
undo_desc = g_filename_to_utf8 (plug_in->name, -1, NULL, NULL, NULL);
undo_desc = g_filename_display_name (plug_in->name);
return undo_desc;
}
......@@ -217,7 +217,7 @@ gimp_filename_to_utf8 (const gchar *filename)
if (! filename_utf8)
{
filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
filename_utf8 = g_filename_display_name (filename);
g_hash_table_insert (ht, g_strdup (filename), filename_utf8);
}
......
......@@ -174,8 +174,12 @@ gimp_module_load (GTypeModule *module)
g_return_val_if_fail (gimp_module->module == NULL, FALSE);
if (gimp_module->verbose)
g_print (_("Loading module: '%s'\n"),
gimp_filename_to_utf8 (gimp_module->filename));
{
gchar *name = g_filename_display_name (gimp_module->filename);
g_print (_("Loading module: '%s'\n"), name);
g_free (name);
}
if (! gimp_module_open (gimp_module))
return FALSE;
......@@ -277,10 +281,10 @@ gimp_module_new (const gchar *filename,
{
if (verbose)
{
gchar *filename_utf8 = g_filename_to_utf8 (filename,
-1, NULL, NULL, NULL);
g_print (_("Skipping module: '%s'\n"), filename_utf8);
g_free (filename_utf8);
gchar *name = g_filename_display_name (filename);
g_print (_("Skipping module: '%s'\n"), name);
g_free (name);
}
module->state = GIMP_MODULE_STATE_NOT_LOADED;
......
......@@ -743,7 +743,7 @@ gimp_path_editor_file_entry_changed (GtkWidget *widget,
return;
}
utf8 = g_filename_to_utf8 (dir, -1, NULL, NULL, NULL);
utf8 = g_filename_display_name (dir);
if (editor->sel_path == NULL)
{
......
......@@ -1293,18 +1293,9 @@ CODE2
filename = gimp_image_get_filename (gimage);
if (filename)
{
gchar *basename = g_path_get_basename (filename);
name = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
g_free (basename);
if (! name)
name = g_strdup (_("(invalid UTF-8 string)"));
}
name = g_filename_display_basename (filename);
else
{
name = g_strdup (_("Untitled"));
}
name = g_strdup (_("Untitled"));
}
CODE2
);
......
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