e-d-s: Make sure consecutive property changes work
authorAlexander Larsson <alexl@redhat.com>
Fri, 9 Sep 2011 12:52:17 +0000 (14:52 +0200)
committerAlexander Larsson <alexl@redhat.com>
Fri, 9 Sep 2011 12:52:17 +0000 (14:52 +0200)
Don't send any notification due to property changes until we've
done updating an entire persona, otherwise code that listens to
such notifies will see the persona in an intermediate state, whic
can cause problems. For instance, if such a callback tries to
change a property it might not recieve change notification for it.

backends/eds/lib/edsf-persona.vala

index cd89ac3..d53d6dd 100644 (file)
@@ -756,6 +756,8 @@ public class Edsf.Persona : Folks.Persona,
     {
       this.contact = contact;
 
+      this.freeze_notify ();
+
       this._update_names ();
       this._update_avatar ();
       this._update_urls ();
@@ -770,6 +772,8 @@ public class Edsf.Persona : Folks.Persona,
       this._update_gender ();
       this._update_birthday ();
       this._update_roles ();
+
+      this.thaw_notify ();
     }
 
   private void _update_params (AbstractFieldDetails details,