Merge branch '137-gfileinfo-display-name-docs' into 'master'

gfileinfo: Clarify docs to say that name and display-name are set

Closes #137

See merge request GNOME/glib!1585
This commit is contained in:
Sebastian Dröge 2020-07-27 13:12:44 +00:00
commit 5ba5f5b686
2 changed files with 8 additions and 7 deletions

View File

@ -1581,9 +1581,9 @@ g_file_info_get_is_symlink (GFileInfo *info)
* g_file_info_get_name:
* @info: a #GFileInfo.
*
* Gets the name for a file.
* Gets the name for a file. This is guaranteed to always be set.
*
* Returns: (type filename): a string containing the file name.
* Returns: (type filename) (not nullable): a string containing the file name.
**/
const char *
g_file_info_get_name (GFileInfo *info)
@ -1604,9 +1604,9 @@ g_file_info_get_name (GFileInfo *info)
* g_file_info_get_display_name:
* @info: a #GFileInfo.
*
* Gets a display name for a file.
* Gets a display name for a file. This is guaranteed to always be set.
*
* Returns: a string containing the display name.
* Returns: (not nullable): a string containing the display name.
**/
const char *
g_file_info_get_display_name (GFileInfo *info)

View File

@ -108,7 +108,8 @@ typedef struct _GFileInfoClass GFileInfoClass;
*
* A key in the "standard" namespace for getting the name of the file.
* The name is the on-disk filename which may not be in any known encoding,
* and can thus not be generally displayed as is.
* and can thus not be generally displayed as is. It is guaranteed to be set on
* every file.
* Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the
* name in a user interface.
* Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
@ -119,8 +120,8 @@ typedef struct _GFileInfoClass GFileInfoClass;
* G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
*
* A key in the "standard" namespace for getting the display name of the file.
* A display name is guaranteed to be in UTF8 and can thus be displayed in
* the UI.
* A display name is guaranteed to be in UTF-8 and can thus be displayed in
* the UI. It is guaranteed to be set on every file.
* Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
**/
#define G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "standard::display-name" /* string */