[folks] Hide setters for PersonaStore.type_id, .display_name and .id



commit 7b3ce82706d4263ee225038e0c914a1c4e94631e
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Fri Sep 10 14:57:01 2010 +0100

    Hide setters for PersonaStore.type_id, .display_name and .id

 backends/key-file/kf-persona-store.vala       |   20 +++++-------------
 backends/telepathy/lib/tpf-persona-store.vala |   26 +++---------------------
 folks/persona-store.vala                      |    6 ++--
 3 files changed, 13 insertions(+), 39 deletions(-)
---
diff --git a/backends/key-file/kf-persona-store.vala b/backends/key-file/kf-persona-store.vala
index 40d2474..7b9986e 100644
--- a/backends/key-file/kf-persona-store.vala
+++ b/backends/key-file/kf-persona-store.vala
@@ -41,17 +41,7 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
   /**
    * { inheritDoc}
    */
-  public override string type_id { get; private set; }
-
-  /**
-   * { inheritDoc}
-   */
-  public override string display_name { get; private set; }
-
-  /**
-   * { inheritDoc}
-   */
-  public override string id { get; private set; }
+  public override string type_id { get { return "key-file"; } }
 
   /**
    * Whether this PersonaStore can add { link Folks.Persona}s.
@@ -129,9 +119,11 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
    */
   public PersonaStore (File key_file)
     {
-      this.type_id = "key-file";
-      this.id = key_file.get_basename ();
-      this.display_name = this.id; /* the user should _never_ see this */
+      string id = key_file.get_basename ();
+
+      Object (id: id,
+              display_name: id);
+
       this.trust_level = PersonaStoreTrust.FULL;
       this.file = key_file;
       this._personas = new HashTable<string, Persona> (str_hash, str_equal);
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index 18b352d..8b2e7f3 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -96,22 +96,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
    *
    * See { link Folks.PersonaStore.type_id}.
    */
-  public override string type_id { get; private set; }
-
-  /**
-   * The human-readable, service-specific name used to represent the
-   * PersonaStore to the user.
-   *
-   * See { link Folks.PersonaStore.display_name}.
-   */
-  public override string display_name { get; private set; }
-
-  /**
-   * The instance identifier for this PersonaStore.
-   *
-   * See { link Folks.PersonaStore.id}.
-   */
-  public override string id { get; private set; }
+  public override string type_id { get { return "telepathy"; } }
 
   /**
    * Whether this PersonaStore can add { link Folks.Persona}s.
@@ -191,12 +176,9 @@ public class Tpf.PersonaStore : Folks.PersonaStore
    */
   public PersonaStore (Account account)
     {
-      Object (account: account);
-
-      this.type_id = "telepathy";
-
-      this.display_name = account.display_name;
-      this.id = account.get_object_path ();
+      Object (account: account,
+              display_name: account.display_name,
+              id: account.get_object_path ());
 
       this.reset ();
     }
diff --git a/folks/persona-store.vala b/folks/persona-store.vala
index db57909..7118cb4 100644
--- a/folks/persona-store.vala
+++ b/folks/persona-store.vala
@@ -142,7 +142,7 @@ public abstract class Folks.PersonaStore : Object
    * This is guaranteed to always be available; even before
    * { link PersonaStore.prepare} is called.
    */
-  public abstract string type_id { get; protected set; }
+  public abstract string type_id { get; }
 
   /**
    * The human-readable, service-specific name used to represent the
@@ -159,7 +159,7 @@ public abstract class Folks.PersonaStore : Object
    *
    * @since 0.1.13
    */
-  public abstract string display_name { get; protected set; }
+  public string display_name { get; construct; }
 
   /**
    * The instance identifier for this PersonaStore.
@@ -168,7 +168,7 @@ public abstract class Folks.PersonaStore : Object
    * for different accounts or servers (for example), they each need an ID
    * which is unique within the backend.
    */
-  public abstract string id { get; protected set; }
+  public string id { get; construct; }
 
   /**
    * The { link Persona}s exposed by this PersonaStore.



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