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 731470 - IndividualAggregator doesn't listen on changes in primary-store gsettings key
IndividualAggregator doesn't listen on changes in primary-store gsettings key
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: general
git master
Other All
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2014-06-10 17:08 UTC by Erick Perez Castellanos
Modified: 2014-09-12 15:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Hook into gsettings changed signal (2.73 KB, patch)
2014-06-10 17:12 UTC, Erick Perez Castellanos
needs-work Details | Review
Make IndividualAggregator listen on settings changes (2.88 KB, patch)
2014-09-10 14:31 UTC, Erick Perez Castellanos
committed Details | Review
unit test for the previous change (6.32 KB, patch)
2014-09-10 14:34 UTC, Erick Perez Castellanos
committed Details | Review

Description Erick Perez Castellanos 2014-06-10 17:08:46 UTC
From Contacts, I allow the user to change the primary-store at runtime, and since IndividualAggregator doesn't allow to set IndividualAggregator::primary_store I could change it by setting the proper value in the gsetting key.

Also, IndividualAggregator doesn't listen for changes of the default-address-book in eds
Comment 1 Erick Perez Castellanos 2014-06-10 17:12:21 UTC
Created attachment 278214 [details] [review]
Hook into gsettings changed signal
Comment 2 Philip Withnall 2014-06-12 08:51:16 UTC
Review of attachment 278214 [details] [review]:

Can you please add a unit test for this in tests/folks? Make it use the dummy backend like standalone-individuals.vala. Thanks.

::: folks/individual-aggregator.vala
@@ +130,3 @@
   private SmallSet<Backend> _backends;
 
+  private Settings _primary_store_setting = null;

This should be nullable, i.e. have type 'Settings?'.

@@ +505,3 @@
           if (val != null && val != "")
             {
               debug ("Setting primary store IDs from GSettings.");

Please factor out this common code which handles val. You could probably call _primary_store_setting_changed_cb() directly to initialise.
Comment 3 Erick Perez Castellanos 2014-09-10 14:31:18 UTC
Created attachment 285828 [details] [review]
Make IndividualAggregator listen on settings changes
Comment 4 Erick Perez Castellanos 2014-09-10 14:34:25 UTC
Created attachment 285829 [details] [review]
unit test for the previous change
Comment 5 Philip Withnall 2014-09-12 15:24:08 UTC
Great, thanks! Merged to master.