[folks] Block notification of Persona.is-favourite when changing it on the Individual



commit ed774c184747ec5d4a870b1343cf5841e92e840d
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Fri Aug 27 13:35:26 2010 +0100

    Block notification of Persona.is-favourite when changing it on the Individual
    
    This fixes changing the favourite status of an Individual containing more than
    one Persona, since previously the change wouldn't be applied. This is because
    the change would be bubbled down to the first Persona, which would then
    notify of the change to its is-individual property, causing the Individual's
    is-favourite property to be re-calculated incorrectly, since the favourite
    status of the _other_ Personas hadn't yet been changed. Closes: bgo#628108

 folks/individual.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/folks/individual.vala b/folks/individual.vala
index fc79761..27e54e2 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -196,7 +196,13 @@ public class Folks.Individual : Object,
           this._persona_list.foreach ((p) =>
             {
               if (p is Favourite)
-                ((Favourite) p).is_favourite = value;
+                {
+                  SignalHandler.block_by_func (p,
+                      (void*) this.notify_is_favourite_cb, this);
+                  ((Favourite) p).is_favourite = value;
+                  SignalHandler.unblock_by_func (p,
+                      (void*) this.notify_is_favourite_cb, this);
+                }
             });
         }
     }



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