X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgfileinfo.c;h=aed7975424a757044b2c0f131cebb3bab45bfd86;hb=9a6146f54cdc085a42095b930066853dbb4e0c67;hp=582e744e3f99dbdfd37864e96b077cbb52f79a26;hpb=becf4186e6289c0ab5d762f1cdf88517f4adc9f5;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c index 582e744..aed7975 100644 --- a/gio/gfileinfo.c +++ b/gio/gfileinfo.c @@ -679,6 +679,42 @@ g_file_info_get_attribute_status (GFileInfo *info, return G_FILE_ATTRIBUTE_STATUS_UNSET; } +/** + * g_file_info_set_attribute_status: + * @info: a #GFileInfo + * @attribute: a file attribute key + * @status: a #GFileAttributeStatus + * + * Sets the attribute status for an attribute key. This is only + * needed by external code that implement g_file_set_attributes_from_info() + * or similar functions. + * + * The attribute must exist in @info for this to work. Otherwise %FALSE + * is returned and @info is unchanged. + * + * Returns: %TRUE if the status was changed, %FALSE if the key was not set. + * + * Since: 2.22 + */ +gboolean +g_file_info_set_attribute_status (GFileInfo *info, + const char *attribute, + GFileAttributeStatus status) +{ + GFileAttributeValue *val; + + g_return_val_if_fail (G_IS_FILE_INFO (info), 0); + g_return_val_if_fail (attribute != NULL && *attribute != '\0', 0); + + val = g_file_info_find_value_by_name (info, attribute); + if (val) + { + val->status = status; + return TRUE; + } + + return FALSE; +} GFileAttributeValue * _g_file_info_get_attribute_value (GFileInfo *info,