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 650422 - Folks needs API for easily checking whether details are writeable
Folks needs API for easily checking whether details are writeable
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: libfolks
git master
Other Linux
: Normal normal
: folks-0.6.0
Assigned To: folks-maint
folks-maint
: 652658 (view as bug list)
Depends on:
Blocks: 652657
 
 
Reported: 2011-05-17 18:27 UTC by Travis Reitter
Modified: 2011-07-20 21:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add Persona.writeable_properties (8.06 KB, patch)
2011-07-10 18:49 UTC, Philip Withnall
committed Details | Review

Description Travis Reitter 2011-05-17 18:27:17 UTC
A contact editor needs a way to show which fields may be modified and which may not. So, eg, if an Individual has 2 personas (one from a writeable store, one note), with one email address from each, the UI needs to communicate which one can be saved back to the store (by putting it in an Entry widget) and which can't (by putting it in a non-editable Label).

Currently, the only way to check whether a detail is modifiable is to iterate through all Personas in the Individual, find the value, and check whether that Persona's PersonaStore is writeable.

Instead, Individuals should maintain some mapping of which details are writeable or we should modify the interfaces to include a is-writeable bit for each value.
Comment 1 Travis Reitter 2011-06-21 14:55:51 UTC
(mass changing milestones)
Comment 2 Philip Withnall 2011-07-10 18:16:21 UTC
*** Bug 652658 has been marked as a duplicate of this bug. ***
Comment 3 Philip Withnall 2011-07-10 18:49:36 UTC
Created attachment 191647 [details] [review]
Add Persona.writeable_properties

https://www.gitorious.org/folks/folks/commits/650422-writeable-properties

The first commit on this branch is the one which actually fixes the bug. The others are to fix minor problems I found with various Persona subclass properties while working on this.
Comment 4 Travis Reitter 2011-07-20 15:58:05 UTC
Review of attachment 191647 [details] [review]:

+   * @since 0.5.UNRELEASED

Cut the "0.5." for all instances of this.


Other than that, this looks good.
Comment 5 Travis Reitter 2011-07-20 16:07:16 UTC
Review of attachment 191647 [details] [review]:

Oh, and please implement this for the EDS backend before merging, of course.
Comment 6 Philip Withnall 2011-07-20 21:33:13 UTC
Comment on attachment 191647 [details] [review]
Add Persona.writeable_properties

Committed with the fixes.

commit 142f9b742847e907425b44070b46960dcb1b208f
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Jul 10 19:52:03 2011 +0100

    Make BirthdayDetails.calendar_event_id nullable
    
    This includes expanding its documentation a little.

 NEWS                                  |    1 +
 backends/tracker/lib/trf-persona.vala |    2 +-
 folks/birthday-details.vala           |    6 ++++--
 3 files changed, 6 insertions(+), 3 deletions(-)

commit 6c03cceabb64ab2282ee58d90ca6e7063ab3bb60
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Jul 10 19:43:20 2011 +0100

    Fix visibility of TrfPersona.postal_addresses setter

 backends/tracker/lib/trf-persona.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 0aec7fb049e7490a279f6c4ff22c9d0ed0673cf3
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Jul 10 19:42:25 2011 +0100

    Add a default implementation of TrfPersona.calendar_event_id
    
    It was missing; it might as well return a sensible default value and not
    allow setting of the value rather than doing nothing.

 backends/tracker/lib/trf-persona.vala |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

commit c81a0d85d254bf80ffefb5f87eb19422894ff21b
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Jul 10 19:41:46 2011 +0100

    Fix visibility of TpfPersona.avatar and SwfPersona.avatar setters

 backends/libsocialweb/lib/swf-persona.vala |    2 +-
 backends/telepathy/lib/tpf-persona.vala    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

commit 22d9011bf6d1c35e79bb2b88c5546fe008542c20
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Jul 10 19:41:23 2011 +0100

    Minor documentation fix for SwfPersona.avatar

 backends/libsocialweb/lib/swf-persona.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit 2483721d1e6f97c37c9fefb830d28e7187bcd7a5
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Jul 10 19:38:16 2011 +0100

    Bug 650422 — Add API for easily checking whether details are writeable
    
    Add Persona.writeable_properties, listing the properties of that Persona
    for which updated values will be stored. It's intended that the property
    value will be constant for a given Persona subclass, but this isn't
    guaranteed; it's possible that Persona subclasses may vary the value of
    writeable-properties at run time in future.
    
    Closes: bgo#650422

 NEWS                                       |    3 +++
 backends/eds/lib/edsf-persona.vala         |   25 +++++++++++++++++++++++++
 backends/key-file/kf-persona.vala          |   16 ++++++++++++++++
 backends/libsocialweb/lib/swf-persona.vala |   11 +++++++++++
 backends/telepathy/lib/tpf-persona.vala    |   16 ++++++++++++++++
 backends/tracker/lib/trf-persona.vala      |   28 ++++++++++++++++++++++++++++
 folks/persona.vala                         |   15 +++++++++++++++
 7 files changed, 114 insertions(+), 0 deletions(-)