Blame SOURCES/0010-Unset-correctly-GVFS-file-attributes.patch

8f91ed
From c1f59ef858a2b6b14f4c05f49cb8d5b4a1642451 Mon Sep 17 00:00:00 2001
8f91ed
From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= <swilmet@gnome.org>
8f91ed
Date: Sun, 7 Jun 2015 18:23:14 +0200
8f91ed
Subject: [PATCH 10/26] Unset correctly GVFS file attributes
8f91ed
8f91ed
remove_attribute() removes the attribute from the FileInfo, so when
8f91ed
calling g_file_set_attributes_from_info(), the attribute value is kept
8f91ed
as-is, it was not unset.
8f91ed
8f91ed
To unset the file attribute, we must set the attribute to an invalid
8f91ed
type (it seems there is no nicer way to do it).
8f91ed
8f91ed
https://bugzilla.gnome.org/show_bug.cgi?id=741853
8f91ed
---
8f91ed
 gedit/gedit-document.c | 10 ++++++++--
8f91ed
 1 file changed, 8 insertions(+), 2 deletions(-)
8f91ed
8f91ed
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
8f91ed
index ab4fab6..cc59ea1 100644
8f91ed
--- a/gedit/gedit-document.c
8f91ed
+++ b/gedit/gedit-document.c
8f91ed
@@ -1662,11 +1662,17 @@ gedit_document_set_metadata (GeditDocument *doc,
8f91ed
 		else
8f91ed
 		{
8f91ed
 			/* Unset the key */
8f91ed
-			g_file_info_remove_attribute (info, key);
8f91ed
+			g_file_info_set_attribute (info,
8f91ed
+						   key,
8f91ed
+						   G_FILE_ATTRIBUTE_TYPE_INVALID,
8f91ed
+						   NULL);
8f91ed
 
8f91ed
 			if (doc->priv->metadata_info != NULL)
8f91ed
 			{
8f91ed
-				g_file_info_remove_attribute (doc->priv->metadata_info, key);
8f91ed
+				g_file_info_set_attribute (doc->priv->metadata_info,
8f91ed
+							   key,
8f91ed
+							   G_FILE_ATTRIBUTE_TYPE_INVALID,
8f91ed
+							   NULL);
8f91ed
 			}
8f91ed
 		}
8f91ed
 	}
8f91ed
-- 
8f91ed
1.8.3.1
8f91ed