mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
Allow setting G_FILE_ATTRIBUTE_TYPE_INVALID attributes in GFileInfo
This is used to unset an attribute in g_file_set_attributes_from_info.
This commit is contained in:
parent
019e8c808f
commit
d884e509db
@ -461,6 +461,9 @@ _g_file_attribute_value_as_string (const GFileAttributeValue *attr)
|
|||||||
((GTypeInstance *) attr->u.obj),
|
((GTypeInstance *) attr->u.obj),
|
||||||
attr->u.obj);
|
attr->u.obj);
|
||||||
break;
|
break;
|
||||||
|
case G_FILE_ATTRIBUTE_TYPE_INVALID:
|
||||||
|
str = g_strdup ("<unset>");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
g_warning ("Invalid type in GFileInfo attribute");
|
g_warning ("Invalid type in GFileInfo attribute");
|
||||||
str = g_strdup ("<invalid>");
|
str = g_strdup ("<invalid>");
|
||||||
@ -693,6 +696,10 @@ _g_file_attribute_value_set_from_pointer (GFileAttributeValue *value,
|
|||||||
case G_FILE_ATTRIBUTE_TYPE_INT64:
|
case G_FILE_ATTRIBUTE_TYPE_INT64:
|
||||||
value->u.int64 = *(gint64 *)value_p;
|
value->u.int64 = *(gint64 *)value_p;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case G_FILE_ATTRIBUTE_TYPE_INVALID:
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
g_warning ("Unknown type specified in g_file_info_set_attribute\n");
|
g_warning ("Unknown type specified in g_file_info_set_attribute\n");
|
||||||
break;
|
break;
|
||||||
|
@ -566,7 +566,7 @@ g_file_info_list_attributes (GFileInfo *info,
|
|||||||
* Gets the attribute type for an attribute key.
|
* Gets the attribute type for an attribute key.
|
||||||
*
|
*
|
||||||
* Returns: a #GFileAttributeType for the given @attribute, or
|
* Returns: a #GFileAttributeType for the given @attribute, or
|
||||||
* %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is invalid.
|
* %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
|
||||||
**/
|
**/
|
||||||
GFileAttributeType
|
GFileAttributeType
|
||||||
g_file_info_get_attribute_type (GFileInfo *info,
|
g_file_info_get_attribute_type (GFileInfo *info,
|
||||||
|
Loading…
Reference in New Issue
Block a user