From 0544fdff5f88a908238f8e48991b5e4d4cebd833 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 27 Jul 2020 00:45:31 +0100 Subject: [PATCH] gfileinfo: Clarify docs to say that name and display-name are set They are always available, for all files. Signed-off-by: Philip Withnall Fixes: #137 --- gio/gfileinfo.c | 8 ++++---- gio/gfileinfo.h | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c index c871809cb..be465c8ca 100644 --- a/gio/gfileinfo.c +++ b/gio/gfileinfo.c @@ -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) diff --git a/gio/gfileinfo.h b/gio/gfileinfo.h index e642d31a0..073a7496b 100644 --- a/gio/gfileinfo.h +++ b/gio/gfileinfo.h @@ -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 */