[folks] core: Add an IndividualAggregator.backend_store property



commit 28821702af19b6ff65aeb18f5514d34d10b00f29
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Wed Nov 27 11:43:49 2013 +0000

    core: Add an IndividualAggregator.backend_store property
    
    This is a simple construct-only getter convenience property. It tidies
    up IndividualAggregator construction a little, and allows runtime access
    to the BackendStore without having to have explicitly constructed it
    before the aggregator.

 NEWS                             |    1 +
 folks/individual-aggregator.vala |   19 +++++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/NEWS b/NEWS
index 063a451..6d393ef 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,7 @@ API changes:
  • Add Individual.display_name
  • Add StructuredName.to_string_with_format()
  • Add libfolks-dummy.la and all its symbols
+ • Add IndividualAggregator.backend_store
 
 Overview of changes from libfolks 0.9.5 to libfolks 0.9.6
 =========================================================
diff --git a/folks/individual-aggregator.vala b/folks/individual-aggregator.vala
index 1815145..06d0f3d 100644
--- a/folks/individual-aggregator.vala
+++ b/folks/individual-aggregator.vala
@@ -217,6 +217,17 @@ public class Folks.IndividualAggregator : Object
       get { return this._primary_store; }
     }
 
+  /**
+   * The backend store providing the persona stores for this aggregator.
+   *
+   * @since UNRELEASED
+   */
+  public BackendStore backend_store
+    {
+      get { return this._backend_store; }
+      construct { this._backend_store = value; }
+    }
+
   private Map<string, Individual> _individuals;
   private Map<string, Individual> _individuals_ro;
 
@@ -376,8 +387,7 @@ public class Folks.IndividualAggregator : Object
       replacement = "IndividualAggregator.dup")]
   public IndividualAggregator ()
   {
-    Object ();
-    this._backend_store = BackendStore.dup ();
+    Object (backend_store: BackendStore.dup ());
   }
 
   /**
@@ -437,8 +447,7 @@ public class Folks.IndividualAggregator : Object
       replacement = "IndividualAggregator.dup_with_backend_store")]
   public IndividualAggregator.with_backend_store (BackendStore store)
   {
-    Object ();
-    this._backend_store = store;
+    Object (backend_store: store);
   }
   
   construct
@@ -504,8 +513,6 @@ public class Folks.IndividualAggregator : Object
       this._linking_enabled = (disable_linking == null ||
           disable_linking == "no" || disable_linking == "0");
 
-      this._backend_store = BackendStore.dup ();
-
       debug ("Constructing IndividualAggregator %p", this);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]