GNOME Bugzilla – Bug 626725
Add an Individual.personas_changed signal
Last modified: 2010-08-26 18:28:40 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.
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
Aargh, this should have a @since line.
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
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.
(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(-)