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 657991 - Use asynchronous property setters
Use asynchronous property setters
Status: RESOLVED FIXED
Product: gnome-contacts
Classification: Core
Component: general
0.1.x
Other All
: Normal normal
: ---
Assigned To: Alexander Larsson
Alexander Larsson
Depends on: 657510
Blocks:
 
 
Reported: 2011-09-01 18:35 UTC by Philip Withnall
Modified: 2011-09-02 18:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use asynchronous property setters (6.53 KB, patch)
2011-09-01 18:38 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2011-09-01 18:35:00 UTC
Shiny new API from bug #657510 which is here to ruin your day. Patch coming.
Comment 1 Philip Withnall 2011-09-01 18:38:48 UTC
Created attachment 195428 [details] [review]
Use asynchronous property setters

As mentioned in the commit message, this patch unfortunately can't be nicer due to the lack of support for async delegates in Vala.

It ports the property setting to use the new async setters and adds a few yield statements, but doesn't do anything new about error handling since I wasn't sure how you wanted to handle it.

If you let me know how you want to handle PropertyError errors which come back from the change_*() methods, I can update the patch/provide a new patch to do that. (The only PropertyErrors you're likely to encounter are obscure ones like “the backend failed to respond in a reasonable amount of time” or “unknown error”, since the code in gnome-contacts already checks whether a property's writeable before attempting to set it.
Comment 2 Alexander Larsson 2011-09-02 08:17:02 UTC
Looks good to me, please commit that when the folks side lands.
Comment 3 Philip Withnall 2011-09-02 18:46:26 UTC
Comment on attachment 195428 [details] [review]
Use asynchronous property setters

commit 461395e64fd49846384bb87f3befb553162a5c94
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Thu Sep 1 19:31:50 2011 +0100

    Bug 657991 — Use asynchronous property setters
    
    Port the contact pane to use the new asynchronous property setters in folks.
    This isn't as tidy as it should be: ideally each editing widget constructor
    would take an async delegate which it calls to set the appropriate property
    values in folks. However, async. delegates aren't supported yet by Vala
    (see: bgo#604827). Therefore we have to make do with a big switch statement
    on the property names. :-(
    
    Closes: bgo#657991

 src/contacts-contact-pane.vala |   16 +++++----
 src/contacts-contact.vala      |   70 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 78 insertions(+), 8 deletions(-)