[gnome-contacts] Don't set full-name in FakePersona twice



commit 2dcea088fce70de30c78a36e72f2ff49f831178f
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Aug 26 12:28:22 2011 +0200

    Don't set full-name in FakePersona twice
    
    If its manually set already, don't set it automatically

 src/contacts-contact.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index 2c00c8a..97812db 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -903,6 +903,7 @@ public class Contacts.FakePersona : Persona {
   }
   private ArrayList<PropVal> prop_vals;
   private bool now_real;
+  private bool has_full_name;
 
   public static FakePersona? maybe_create_for (Contact contact) {
     var primary_persona = contact.find_primary_persona ();
@@ -930,11 +931,15 @@ public class Contacts.FakePersona : Persona {
     var v = new PropVal ();
     v.property = property;
     v.value = value;
+    if (property == "full-name")
+      has_full_name = true;
+
     if (prop_vals == null) {
       prop_vals = new ArrayList<PropVal> ();
       prop_vals.add (v);
       Persona p = yield contact.ensure_primary_persona ();
-      p.set ("full-name", contact.display_name);
+      if (!has_full_name)
+	p.set ("full-name", contact.display_name);
       foreach (var pv in prop_vals) {
 	p.set_property (pv.property, pv.value);
       }



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