[gnome-contacts/new-design: 1/6] Add Contact.get_personas_for_display
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts/new-design: 1/6] Add Contact.get_personas_for_display
- Date: Wed, 7 Dec 2011 21:00:43 +0000 (UTC)
commit e5b885a7036bb23ebbe7064380f952fb8c3b839d
Author: Alexander Larsson <alexl redhat com>
Date: Mon Dec 5 17:13:42 2011 +0100
Add Contact.get_personas_for_display
src/contacts-contact.vala | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index d598563..30cac49 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -951,6 +951,24 @@ public class Contacts.Contact : GLib.Object {
return null;
}
+ public Gee.List<Persona> get_personas_for_display () {
+ var persona_list = new ArrayList<Persona>();
+ int i = 0;
+ persona_list.add_all (individual.personas);
+ while (i < persona_list.size) {
+ if (persona_list[i].store.type_id == "key-file")
+ persona_list.remove_at (i);
+ else
+ i++;
+ }
+ var fake_persona = FakePersona.maybe_create_for (this);
+ if (fake_persona != null)
+ persona_list.add (fake_persona);
+ persona_list.sort (Contact.compare_persona_by_store);
+
+ return persona_list;
+ }
+
public Persona? find_primary_persona () {
return find_persona_from_store (store.aggregator.primary_store);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]