mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-02 07:36:17 +01:00
Add g_filename_display_basename.
2004-12-15 Alexander Larsson <alexl@redhat.com> * glib/gconvert.[ch]: Add g_filename_display_basename.
This commit is contained in:
parent
80aded0d23
commit
aba9e78ec4
@ -1,3 +1,8 @@
|
||||
2004-12-15 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* glib/gconvert.[ch]:
|
||||
Add g_filename_display_basename.
|
||||
|
||||
2004-12-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* README.in: Updates
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-12-15 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* glib/gconvert.[ch]:
|
||||
Add g_filename_display_basename.
|
||||
|
||||
2004-12-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* README.in: Updates
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-12-15 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* glib/gconvert.[ch]:
|
||||
Add g_filename_display_basename.
|
||||
|
||||
2004-12-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* README.in: Updates
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-12-15 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* glib/gconvert.[ch]:
|
||||
Add g_filename_display_basename.
|
||||
|
||||
2004-12-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* README.in: Updates
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-12-15 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* glib/gconvert.[ch]:
|
||||
Add g_filename_display_basename.
|
||||
|
||||
2004-12-14 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* README.in: Updates
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-12-15 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* glib/glib-sections.txt:
|
||||
Add g_filename_display_basename
|
||||
|
||||
2004-12-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gobject/tmpl/generic_values.sgml: Document some return
|
||||
|
@ -2082,6 +2082,7 @@ g_filename_from_uri
|
||||
g_filename_to_uri
|
||||
g_get_filename_charsets
|
||||
g_filename_display_name
|
||||
g_filename_display_basename
|
||||
g_uri_list_extract_uris
|
||||
g_locale_from_utf8
|
||||
GConvertError
|
||||
|
@ -1906,6 +1906,38 @@ make_valid_utf8 (const gchar *name)
|
||||
return g_string_free (string, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* g_filename_display_basename:
|
||||
* @filename: an absolute pathname in the GLib file name encoding
|
||||
*
|
||||
* Returns the display basename for the particular filename, guaranteed
|
||||
* to be valid UTF-8. The display name might not be identical to the filename,
|
||||
* for instance there might be problems converting it to UTF-8, and some files
|
||||
* can be translated in the display
|
||||
*
|
||||
* You must pass the whole absolute pathname to this functions so that
|
||||
* translation of well known locations can be done.
|
||||
*
|
||||
* This function is prefered over g_filename_display_name() if you know the
|
||||
* whole path, as it allows translation.
|
||||
*
|
||||
* Return value: a newly allocated string containing
|
||||
* a rendition of the basename of the filename in valid UTF-8
|
||||
*
|
||||
* Since: 2.6
|
||||
**/
|
||||
gchar *
|
||||
g_filename_display_basename (const gchar *filename)
|
||||
{
|
||||
char *basename;
|
||||
char *display_name;
|
||||
|
||||
basename = g_path_get_basename (filename);
|
||||
display_name = g_filename_display_name (basename);
|
||||
g_free (basename);
|
||||
return display_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_filename_display_name:
|
||||
* @filename: a pathname hopefully in the GLib file name encoding
|
||||
@ -1918,6 +1950,10 @@ make_valid_utf8 (const gchar *name)
|
||||
* to be non-NULL even if the filename actually isn't in the GLib
|
||||
* file name encoding.
|
||||
*
|
||||
* If you know the whole pathname of the file you should use
|
||||
* g_filename_display_basename(), since that allows location-based
|
||||
* translation of filenames.
|
||||
*
|
||||
* Return value: a newly allocated string containing
|
||||
* a rendition of the filename in valid UTF-8
|
||||
*
|
||||
|
@ -126,6 +126,8 @@ gchar *g_filename_to_uri (const gchar *filename,
|
||||
gchar *g_filename_display_name (const gchar *filename) G_GNUC_MALLOC;
|
||||
gboolean g_get_filename_charsets (G_CONST_RETURN gchar ***charsets);
|
||||
|
||||
gchar *g_filename_display_basename (const gchar *filename) G_GNUC_MALLOC;
|
||||
|
||||
gchar **g_uri_list_extract_uris (const gchar *uri_list) G_GNUC_MALLOC;
|
||||
|
||||
G_END_DECLS
|
||||
|
Loading…
Reference in New Issue
Block a user