[gedit/gnome-3-14] Unset correctly GVFS file attributes
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/gnome-3-14] Unset correctly GVFS file attributes
- Date: Sun, 7 Jun 2015 16:31:06 +0000 (UTC)
commit c1f59ef858a2b6b14f4c05f49cb8d5b4a1642451
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Jun 7 18:23:14 2015 +0200
Unset correctly GVFS file attributes
remove_attribute() removes the attribute from the FileInfo, so when
calling g_file_set_attributes_from_info(), the attribute value is kept
as-is, it was not unset.
To unset the file attribute, we must set the attribute to an invalid
type (it seems there is no nicer way to do it).
https://bugzilla.gnome.org/show_bug.cgi?id=741853
gedit/gedit-document.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index ab4fab6..cc59ea1 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -1662,11 +1662,17 @@ gedit_document_set_metadata (GeditDocument *doc,
else
{
/* Unset the key */
- g_file_info_remove_attribute (info, key);
+ g_file_info_set_attribute (info,
+ key,
+ G_FILE_ATTRIBUTE_TYPE_INVALID,
+ NULL);
if (doc->priv->metadata_info != NULL)
{
- g_file_info_remove_attribute (doc->priv->metadata_info, key);
+ g_file_info_set_attribute (doc->priv->metadata_info,
+ key,
+ G_FILE_ATTRIBUTE_TYPE_INVALID,
+ NULL);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]