[nautilus] Support unsetting metadata
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [nautilus] Support unsetting metadata
- Date: Thu, 25 Jun 2009 19:22:47 +0000 (UTC)
commit 7874f2d9422618107edabd7056b7167844c389ca
Author: Alexander Larsson <alexl redhat com>
Date: Thu Jun 25 09:23:27 2009 +0200
Support unsetting metadata
libnautilus-private/nautilus-file.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 235e26a..5c478d0 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3291,13 +3291,15 @@ nautilus_file_set_metadata (NautilusFile *file,
val = default_metadata;
}
- if (val == NULL) {
- g_print ("TODO: setting NULL string metadata");
- val = "<null>";
- }
-
gio_key = g_strconcat ("metadata::", key, NULL);
- g_file_info_set_attribute_string (info, gio_key, val);
+ if (val != NULL) {
+ g_file_info_set_attribute_string (info, gio_key, val);
+ } else {
+ /* Unset the key */
+ g_file_info_set_attribute (info, gio_key,
+ G_FILE_ATTRIBUTE_TYPE_INVALID,
+ NULL);
+ }
g_free (gio_key);
location = nautilus_file_get_location (file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]