From 00ada566e82fef5ed87793b2de7c5cb6e2910ef2 Mon Sep 17 00:00:00 2001 From: Raul Gutierrez Segales Date: Thu, 15 Sep 2011 15:38:11 +0100 Subject: [PATCH] e-d-s: notify when an address book is configured as default Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=657141 --- NEWS | 1 + backends/eds/lib/edsf-persona-store.vala | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/NEWS b/NEWS index 3a55cf8..288a184 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Bugs fixed: * Bug 658323 — Deprecate FOLKS_WRITEABLE_STORE in favour of FOLKS_PRIMARY_STORE * Bug 659095 — Don't distribute typelib file * Bug 659128 — If a persona store goes away we don't remove its personas +* Bug 657141 — Backend should ask eds for the default backend, not hardcode it API changes: * Individual.avatar is now settable using Individual.change_avatar() (not new diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala index 07e87e6..5f56492 100644 --- a/backends/eds/lib/edsf-persona-store.vala +++ b/backends/eds/lib/edsf-persona-store.vala @@ -209,6 +209,8 @@ public class Edsf.PersonaStore : Folks.PersonaStore this._personas = new HashMap (); this._personas_ro = this._personas.read_only_view; this._query_str = "(contains \"x-evolution-any-field\" \"\")"; + this._source.changed.connect (this._source_changed_cb); + this._notify_if_default (); } ~PersonaStore () @@ -1851,4 +1853,23 @@ public class Edsf.PersonaStore : Folks.PersonaStore else this.trust_level = PersonaStoreTrust.FULL; } + + private void _source_changed_cb () + { + this._notify_if_default (); + } + + private void _notify_if_default () + { + bool is_default = false; + if (this._source.get_property ("default") == "true") + { + is_default = true; + } + + if (is_default != this.is_user_set_default) + { + this.is_user_set_default = is_default; + } + } } -- 2.7.4