From d52df73c39411d4df77e22cf97a68e1b2936edae Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Sun, 21 Jan 2018 15:36:50 +0100 Subject: Store: use the BackendStore for the IndividualAggregator This means we also don't need to separately save it. --- src/contacts-store.vala | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/contacts-store.vala b/src/contacts-store.vala index c1653e4..e2c97ae 100644 --- a/src/contacts-store.vala +++ b/src/contacts-store.vala @@ -30,8 +30,8 @@ public class Contacts.Store : GLib.Object { public signal void eds_persona_store_changed (); public IndividualAggregator aggregator { get; private set; } - public BackendStore backend_store { get; private set; } - Gee.ArrayList contacts; + public BackendStore backend_store { get { return this.aggregator.backend_store; } } + private ArrayList contacts; public Gee.HashMultiMap dont_suggest_link; @@ -137,19 +137,19 @@ public class Contacts.Store : GLib.Object { dont_suggest_link = new Gee.HashMultiMap (); read_dont_suggest_db (); - backend_store = BackendStore.dup (); + var backend_store = BackendStore.dup (); backend_store.backend_available.connect ((backend) => { - if (backend.name == "eds") { - backend.persona_store_added.connect (() => { - eds_persona_store_changed (); - }); - backend.persona_store_removed.connect (() => { - eds_persona_store_changed (); - }); - } + if (backend.name == "eds") { + backend.persona_store_added.connect (() => { + eds_persona_store_changed (); + }); + backend.persona_store_removed.connect (() => { + eds_persona_store_changed (); + }); + } }); - aggregator = IndividualAggregator.dup (); + this.aggregator = IndividualAggregator.dup_with_backend_store (backend_store); aggregator.notify["is-quiescent"].connect ( (obj, pspec) => { // We seem to get this before individuals_changed, so hack around it Idle.add( () => { -- cgit v1.2.1