[glib] Allow setting G_FILE_ATTRIBUTE_TYPE_INVALID attributes in GFileInfo
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [glib] Allow setting G_FILE_ATTRIBUTE_TYPE_INVALID attributes in GFileInfo
- Date: Thu, 25 Jun 2009 07:24:44 +0000 (UTC)
commit d884e509db1ab6a6d388313d28b7b07cebb3dfc0
Author: Alexander Larsson <alexl redhat com>
Date: Thu Jun 25 09:18:01 2009 +0200
Allow setting G_FILE_ATTRIBUTE_TYPE_INVALID attributes in GFileInfo
This is used to unset an attribute in g_file_set_attributes_from_info.
gio/gfileattribute.c | 7 +++++++
gio/gfileinfo.c | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gio/gfileattribute.c b/gio/gfileattribute.c
index 671c7cc..4fb6ffa 100644
--- a/gio/gfileattribute.c
+++ b/gio/gfileattribute.c
@@ -461,6 +461,9 @@ _g_file_attribute_value_as_string (const GFileAttributeValue *attr)
((GTypeInstance *) attr->u.obj),
attr->u.obj);
break;
+ case G_FILE_ATTRIBUTE_TYPE_INVALID:
+ str = g_strdup ("<unset>");
+ break;
default:
g_warning ("Invalid type in GFileInfo attribute");
str = g_strdup ("<invalid>");
@@ -693,6 +696,10 @@ _g_file_attribute_value_set_from_pointer (GFileAttributeValue *value,
case G_FILE_ATTRIBUTE_TYPE_INT64:
value->u.int64 = *(gint64 *)value_p;
break;
+
+ case G_FILE_ATTRIBUTE_TYPE_INVALID:
+ break;
+
default:
g_warning ("Unknown type specified in g_file_info_set_attribute\n");
break;
diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c
index aed7975..2785a10 100644
--- a/gio/gfileinfo.c
+++ b/gio/gfileinfo.c
@@ -566,7 +566,7 @@ g_file_info_list_attributes (GFileInfo *info,
* Gets the attribute type for an attribute key.
*
* 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
g_file_info_get_attribute_type (GFileInfo *info,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]