After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683452 - gnome-contacts starts up with an empty address book
gnome-contacts starts up with an empty address book
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: e-d-s backend
git master
Other Linux
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2012-09-05 23:44 UTC by Giovanni Campagna
Modified: 2012-09-06 06:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
EDS: Lazy initialize groups when checking if a google contact is personal (1.11 KB, patch)
2012-09-05 23:44 UTC, Giovanni Campagna
none Details | Review

Description Giovanni Campagna 2012-09-05 23:44:26 UTC
If gnome-contacts is configured for Google, it always starts empty and erroneously marks all contacts as other.
Comment 1 Giovanni Campagna 2012-09-05 23:44:38 UTC
Created attachment 223585 [details] [review]
EDS: Lazy initialize groups when checking if a google contact is personal

Edsf.Persona.in_google_personal_group is set during group parsing, but
that might not happen if the application never accesses Folks.GroupDetails.groups.
Insteady, lazy initialize the groups property when accessing the boolean.
Comment 2 Philip Withnall 2012-09-06 06:42:35 UTC
Committed a modified version of your patch. Thanks!

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(-)