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 626725 - Add an Individual.personas_changed signal
Add an Individual.personas_changed signal
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: libfolks
git master
Other Linux
: Normal enhancement
: gnome-2.32
Assigned To: folks-maint
folks-maint
Depends on:
Blocks: 627402 627706
 
 
Reported: 2010-08-12 11:02 UTC by Philip Withnall
Modified: 2010-08-26 18:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Squashed diff of the 626725-personas-changed branch (16.12 KB, patch)
2010-08-19 17:04 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2010-08-12 11:02:21 UTC
It would be quite useful to have an Individual.personas_changed signal:

public signal void personas_changed (GLib.List<Persona>? added, GLib.List<Persona>? removed);

I've found myself having to write bits of code to determine which personas are new and which have been removed when handling Individual.notify::personas quite a few times in Empathy.
Comment 1 Philip Withnall 2010-08-19 17:04:22 UTC
Created attachment 168302 [details] [review]
Squashed diff of the 626725-personas-changed branch

http://git.collabora.co.uk/?p=user/pwith/folks;a=shortlog;h=refs/heads/626725-personas-changed
Comment 2 Philip Withnall 2010-08-23 15:00:04 UTC
Aargh, this should have a @since line.
Comment 3 Philip Withnall 2010-08-23 16:51:06 UTC
Updated branch. The patch hasn't changed enough to warrant another version of it.

http://git.collabora.co.uk/?p=user/pwith/folks;a=shortlog;h=refs/heads/626725-personas-changed-rebase1
Comment 4 Travis Reitter 2010-08-26 17:58:45 UTC
Review of attachment 168302 [details] [review]:

+          if (this._persona_set.remove (p))
             {
+              this._persona_list.remove (p);

HashSet.remove() is deprecated; use HashSet.unset().

Other than that, these commits look good. Please merge.
Comment 5 Philip Withnall 2010-08-26 18:28:28 UTC
(In reply to comment #4)
> Review of attachment 168302 [details] [review]:
> 
> +          if (this._persona_set.remove (p))
>              {
> +              this._persona_list.remove (p);
> 
> HashSet.remove() is deprecated; use HashSet.unset().

Not introduced by my patch. I'll fix it in a later commit.

> Other than that, these commits look good. Please merge.

commit 40e2b0181123bf1bc82d3bbc8dab22c0e7ef2440
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Thu Aug 19 17:59:27 2010 +0100

    Only keep one reference to each Persona in an Individual

 folks/individual.vala |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

commit 15947652e0e31dad9bf9061565c5b243b628572c
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Thu Aug 19 17:55:02 2010 +0100

    Bug 626725 — Add an Individual.personas_changed signal
    
    Add a personas_changed signal, allowing client code to do various things
    with the lists of added and removed Personas, instead of having to determine
    which Personas were added or removed themselves. Closes: bgo#626725

 folks/individual.vala |  185 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 125 insertions(+), 60 deletions(-)

commit 8cebb98c04b20eaf0efd04b68d92f2a1a0dd789d
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Thu Aug 19 16:17:08 2010 +0100

    Store a set of Personas inside each Individual for speed of lookup
    
    Store a set of all the Personas in the Individual, rather than
    compartmentalised sets of the Personas from each PersonaStore. With the
    set of Personas kept in sync with the list of Personas, this allows both
    fast lookup and iteration.

 folks/individual.vala |  154 +++++++++++++++++++++++-------------------------
 1 files changed, 74 insertions(+), 80 deletions(-)