[gnome-contacts] Don't show fake primary personas if there is a writeable eds persona



commit d143dda13f4268ded7cb2d7cc574d2206a0303a2
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Sep 14 15:51:48 2011 +0200

    Don't show fake primary personas if there is a writeable eds persona
    
    There really is no need to have the fake primary persona when you're
    editing something that has a full scale editable eds persona anyway,
    it just looks confusing.

 src/contacts-contact.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index c90a82b..2ac3479 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -1075,6 +1075,15 @@ public class Contacts.FakePersona : Persona {
     if (primary_persona != null)
       return null;
 
+    foreach (var p in contact.individual.personas) {
+      // Don't fake a primary persona if we have an eds
+      // persona on a non-readonly store
+      if (p.store.type_id == "eds" &&
+	  p.store.can_add_personas == MaybeBool.TRUE &&
+	  p.store.can_remove_personas == MaybeBool.TRUE)
+	return null;
+    }
+
     return new FakePersona (contact);
   }
 



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