[folks] Prefer earlier alphabetical uid persona when two personas from the same persona store. Fixes bug htt



commit e5f873bc4ac5909f5c777e9f2df6f36ae69089f8
Author: Jeremy Whiting <jpwhiting kde org>
Date:   Mon Aug 6 20:13:00 2012 -0600

    Prefer earlier alphabetical uid persona when two personas from the same persona store.
    Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=681346

 NEWS                  |    1 +
 folks/individual.vala |    9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 0df130c..5a7a00b 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Overview of changes from libfolks 0.7.3 to libfolks 0.7.4
 =========================================================
 
 Bugs fixed:
+â Bug 681346 â Individual id can be inconsistent
 
 Overview of changes from libfolks 0.7.2 to libfolks 0.7.3
 =========================================================
diff --git a/folks/individual.vala b/folks/individual.vala
index e6e3890..18015dc 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -2162,6 +2162,7 @@ public class Folks.Individual : Object,
        *  1. store.is-primary-store
        *  2. store.trust-level
        *  3. store.id (alphabetically)
+       *  4. persona.uid (alphabetically)
        *
        * Note that this heuristic shouldn't be changed without careful thought,
        * since stored references to IDs may be broken by the change.
@@ -2190,7 +2191,13 @@ public class Folks.Individual : Object,
                           persona.store.is_primary_store &&
                       _chosen_persona.store.trust_level ==
                           persona.store.trust_level &&
-                      _chosen_persona.store.id > persona.store.id)
+                      _chosen_persona.store.id > persona.store.id) ||
+                  (_chosen_persona.store.is_primary_store ==
+                          persona.store.is_primary_store &&
+                      _chosen_persona.store.trust_level ==
+                          persona.store.trust_level &&
+                      _chosen_persona.store.id == persona.store.id &&
+                      _chosen_persona.uid > persona.uid)
                  )
                {
                  chosen_persona = persona;



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