[folks] Add a display-name property to PersonaStore



commit d844d677583b838946d3906d2c248bedf3f4441e
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Tue Aug 3 17:07:10 2010 -0400

    Add a display-name property to PersonaStore
    
    This is equivalent to display-id for Persona.

 backends/key-file/kf-persona-store.vala   |    6 ++++++
 backends/telepathy/tpf-persona-store.vala |    7 +++++++
 folks/persona-store.vala                  |   15 +++++++++++++++
 3 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/backends/key-file/kf-persona-store.vala b/backends/key-file/kf-persona-store.vala
index d57b592..425b559 100644
--- a/backends/key-file/kf-persona-store.vala
+++ b/backends/key-file/kf-persona-store.vala
@@ -41,6 +41,11 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
   /**
    * { inheritDoc}
    */
+  public override string display_name { get; private set; }
+
+  /**
+   * { inheritDoc}
+   */
   public override string id { get; private set; }
 
   /**
@@ -61,6 +66,7 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
     {
       this.type_id = "key-file";
       this.id = key_file.get_basename ();
+      this.display_name = this.id; /* the user should _never_ see this */
       this.trust_level = PersonaStoreTrust.FULL;
       this.file = key_file;
       this._personas = new HashTable<string, Persona> (str_hash, str_equal);
diff --git a/backends/telepathy/tpf-persona-store.vala b/backends/telepathy/tpf-persona-store.vala
index c081fbf..4391154 100644
--- a/backends/telepathy/tpf-persona-store.vala
+++ b/backends/telepathy/tpf-persona-store.vala
@@ -76,6 +76,11 @@ public class Tpf.PersonaStore : Folks.PersonaStore
   /**
    * { inheritDoc}
    */
+  public override string display_name { get; private set; }
+
+  /**
+   * { inheritDoc}
+   */
   public override string id { get; private set; }
 
   /**
@@ -97,6 +102,8 @@ public class Tpf.PersonaStore : Folks.PersonaStore
       Object (account: account);
 
       this.type_id = "telepathy";
+
+      this.display_name = account.display_name;
       this.id = account.get_object_path ();
 
       this.reset ();
diff --git a/folks/persona-store.vala b/folks/persona-store.vala
index 426c767..71d1954 100644
--- a/folks/persona-store.vala
+++ b/folks/persona-store.vala
@@ -123,6 +123,21 @@ public abstract class Folks.PersonaStore : Object
   public abstract string type_id { get; protected set; }
 
   /**
+   * The human-readable, service-specific name used to represent the
+   * PersonaStore to the user.
+   *
+   * For example: `foo@@xmpp.example.org`.
+   *
+   * This should be used whenever the user needs to be presented with a
+   * familiar, service-specific name. For instance, in a prompt for the user to
+   * select a specific IM account from which to initiate a chat.
+   *
+   * This is not guaranteed to be unique even within this PersonaStore's
+   * { link Backend}.
+   */
+  public abstract string display_name { get; protected set; }
+
+  /**
    * The instance identifier for this PersonaStore.
    *
    * Since each { link Backend} can provide multiple different PersonaStores



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