From 27a630efb78d0bc55d7fe5e60ba425a307f8efef Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 12 Sep 2011 23:31:06 +0100 Subject: [PATCH] =?utf8?q?Bug=20658331=20=E2=80=94=20Ensure=20read-only=20?= =?utf8?q?PersonaStores=20have=20empty=20writeable-properties?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ensure that Edsf.PersonaStore.always-writeable-properties is empty for EDS address books which are read-only. Similarly, ensure that Edsf.Persona.writeable-properties is also empty for such address books (which follows because it passes through the value of always-writeable-properties). No other backends need modifying for this, since no others have a concept of “read only” except libsocialweb, which already has empty writeable-properties properties. Closes: bgo#658331 --- NEWS | 1 + backends/eds/lib/edsf-persona-store.vala | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 63502d8..3dd52c8 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ Overview of changes from libfolks 0.6.2.1 to libfolks 0.6.3 Bugs fixed: * Bug 658631 — crash at empathy startup +* Bug 658331 — Ensure read-only PersonaStores have empty writeable-properties Overview of changes from libfolks 0.6.2 to libfolks 0.6.2.1 =========================================================== diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala index 715ec24..90c160f 100644 --- a/backends/eds/lib/edsf-persona-store.vala +++ b/backends/eds/lib/edsf-persona-store.vala @@ -145,6 +145,7 @@ public class Edsf.PersonaStore : Folks.PersonaStore } private string[] _always_writeable_properties = {}; + private static string[] _always_writeable_properties_empty = {}; /* oh Vala */ /** * {@inheritDoc} @@ -153,7 +154,15 @@ public class Edsf.PersonaStore : Folks.PersonaStore */ public override string[] always_writeable_properties { - get { return this._always_writeable_properties; } + get + { + if (this._addressbook.readonly == true) + { + return this._always_writeable_properties_empty; + } + + return this._always_writeable_properties; + } } /* -- 2.7.4