[gnome-contacts] Store: use the BackendStore for the IndividualAggregator
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Store: use the BackendStore for the IndividualAggregator
- Date: Sun, 21 Jan 2018 15:52:48 +0000 (UTC)
commit d52df73c39411d4df77e22cf97a68e1b2936edae
Author: Niels De Graef <nielsdegraef gmail com>
Date: Sun Jan 21 15:36:50 2018 +0100
Store: use the BackendStore for the IndividualAggregator
This means we also don't need to separately save it.
src/contacts-store.vala | 24 ++++++++++++------------
1 files 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<Contact> contacts;
+ public BackendStore backend_store { get { return this.aggregator.backend_store; } }
+ private ArrayList<Contact> contacts;
public Gee.HashMultiMap<string, string> dont_suggest_link;
@@ -137,19 +137,19 @@ public class Contacts.Store : GLib.Object {
dont_suggest_link = new Gee.HashMultiMap<string, string> ();
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( () => {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]