=?utf-8?q?=5Bfolks=5D_Bug_683452_=E2=80=94_gnome-contacts_starts_up_with_?= =?utf-8?q?an_empty_address_book?=



commit 2aea61a5ba58a4947753f1f5107d4566f84e6c93
Author: Philip Withnall <philip tecnocode co uk>
Date:   Thu Sep 6 07:40:27 2012 +0100

    Bug 683452 â gnome-contacts starts up with an empty address book
    
    Edsf.Persona.is_google_personal_group and .is_favourite can both be set by
    the _update_groups() method. Groups must be lazily initialised when
    accessing these properties, therefore.
    
    Based on a patch by Giovanni Campagna <scampa giovanni gmail com>.
    
    Closes: https://bugzilla.gnome.org/show_bug.cgi?id=683452

 NEWS                               |    1 +
 backends/eds/lib/edsf-persona.vala |   16 ++++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index 681c1d0..c1df5c5 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ Bugs fixed:
 â Bug 680335 â empathy crashed with SIGSEGV in
   _tpf_persona_contact_weak_notify_cb()
 â Bug 681726 â empathy crashed with SIGABRT in g_assertion_message()
+â Bug 683452 â gnome-contacts starts up with an empty address book
 
 API changes:
 â Add PropertyError.UNAVAILABLE
diff --git a/backends/eds/lib/edsf-persona.vala b/backends/eds/lib/edsf-persona.vala
index 3acd098..b0c20af 100644
--- a/backends/eds/lib/edsf-persona.vala
+++ b/backends/eds/lib/edsf-persona.vala
@@ -151,8 +151,6 @@ public class Edsf.Persona : Folks.Persona,
 
   private static HashTable<string, E.ContactField>? _im_eds_map = null;
 
-  private bool _is_favourite;
-
   private E.Contact _contact; /* should be set on construct */
 
   /**
@@ -692,6 +690,8 @@ public class Edsf.Persona : Folks.Persona,
       yield ((Edsf.PersonaStore) this.store)._set_roles (this, roles);
     }
 
+  private bool _is_favourite = false;
+
   /**
    * Whether this contact is a user-defined favourite.
    *
@@ -700,7 +700,11 @@ public class Edsf.Persona : Folks.Persona,
   [CCode (notify = false)]
   public bool is_favourite
       {
-        get { return this._is_favourite; }
+        get
+          {
+            this._update_groups (true); /* also checks for favourites */
+            return this._is_favourite;
+          }
         set { this.change_is_favourite.begin (value); }
       }
 
@@ -757,7 +761,11 @@ public class Edsf.Persona : Folks.Persona,
   [CCode (notify = false)]
   public bool in_google_personal_group
     {
-      get { return this._in_google_personal_group; }
+      get
+        {
+          this._update_groups (true); /* also checks for the personal group */
+          return this._in_google_personal_group;
+        }
     }
 
   /**



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