[folks] Don't set Individual.alias when updating the alias from Personas



commit 5e414f6d922f0535c5699ecb89d00c1618ea4d5a
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Mon Aug 30 16:46:12 2010 +0100

    Don't set Individual.alias when updating the alias from Personas
    
    Set the private Individual._alias member instead, to prevent the changed
    alias (which could be a fallback display ID or similar) from being pushed
    down to all the Personas and stomping all over their aliases.
    Helps: bgo#628131

 folks/individual.vala |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/folks/individual.vala b/folks/individual.vala
index 7529f76..f8c7f0b 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -565,9 +565,15 @@ public class Folks.Individual : Object,
               "instead: %s", alias);
         }
 
-      /* only notify if the value has changed */
-      if (this.alias != alias)
-        this.alias = alias;
+      /* Only notify if the value has changed. We have to set the private member
+       * and notify manually, or we'd end up propagating the new alias back
+       * down to all our Personas, even if it's a fallback display ID or
+       * something else undesirable. */
+      if (this._alias != alias)
+        {
+          this._alias = alias;
+          this.notify_property ("alias");
+        }
     }
 
   private void update_avatar ()



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