[folks] Allow Edsf.PersonaStore._set_*name() sname arg to be null.



commit dbca8f7fe23a36925c7263e1e51e58f7c096b1e0
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Thu Jul 21 13:16:08 2011 -0700

    Allow Edsf.PersonaStore._set_*name() sname arg to be null.
    
    Helps: bgo#655019 - Don't notify twice for nickname changes

 backends/eds/lib/edsf-persona-store.vala |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index a4a118e..668fb4c 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -744,7 +744,7 @@ public class Edsf.PersonaStore : Folks.PersonaStore
     }
 
   internal async void _set_structured_name (Edsf.Persona persona,
-      StructuredName sname)
+      StructuredName? sname)
     {
       try
         {
@@ -759,15 +759,18 @@ public class Edsf.PersonaStore : Folks.PersonaStore
     }
 
   private async void _set_contact_name (E.Contact contact,
-      StructuredName sname)
+      StructuredName? sname)
     {
       E.ContactName contact_name = new E.ContactName ();
 
-      contact_name.family = sname.family_name;
-      contact_name.given = sname.given_name;
-      contact_name.additional = sname.additional_names;
-      contact_name.suffixes = sname.suffixes;
-      contact_name.prefixes = sname.prefixes;
+      if (sname != null)
+        {
+          contact_name.family = sname.family_name;
+          contact_name.given = sname.given_name;
+          contact_name.additional = sname.additional_names;
+          contact_name.suffixes = sname.suffixes;
+          contact_name.prefixes = sname.prefixes;
+        }
 
       contact.set (E.Contact.field_id ("name"), contact_name);
     }



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