[gvfs] Support unsetting metadata in g_file_set_attributes_from_info()



commit 74b5208891e87f88f5902c427fe63bf2bf67257e
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jun 25 09:20:44 2009 +0200

    Support unsetting metadata in g_file_set_attributes_from_info()

 client/gdaemonvfs.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index a352cfd..06afd6c 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -1318,6 +1318,21 @@ g_daemon_vfs_local_file_set_attributes (GVfs       *vfs,
 		  g_file_info_set_attribute_status (info, attributes[i],
 						    G_FILE_ATTRIBUTE_STATUS_SET);
 		}
+	      else if (type == G_FILE_ATTRIBUTE_TYPE_INVALID)
+		{
+		  if (meta_tree_lookup_key_type (tree, tree_path, key) != META_KEY_TYPE_NONE)
+		    {
+		      char c = 0;
+		      num_set++;
+		      /* Byte => unset */
+		      _g_dbus_message_append_args (message,
+						   DBUS_TYPE_STRING, &key,
+						   DBUS_TYPE_BYTE, &c,
+						   0);
+		    }
+		  g_file_info_set_attribute_status (info, attributes[i],
+						    G_FILE_ATTRIBUTE_STATUS_SET);
+		}
 	      else
 		{
 		  res = FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]