[folks] Manually iterate through personas in remove_individual().
- From: Travis Reitter <treitter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] Manually iterate through personas in remove_individual().
- Date: Tue, 3 Aug 2010 21:21:38 +0000 (UTC)
commit e6edfc2cfd33b4f4309e5ae87f6e38de7e62f4f6
Author: Philip Withnall <philip withnall collabora co uk>
Date: Fri Jul 23 12:21:22 2010 +0100
Manually iterate through personas in remove_individual().
This lets us properly yield upon remove_persona().
folks/individual-aggregator.vala | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/folks/individual-aggregator.vala b/folks/individual-aggregator.vala
index 8557de7..a2641a0 100644
--- a/folks/individual-aggregator.vala
+++ b/folks/individual-aggregator.vala
@@ -319,8 +319,14 @@ public class Folks.IndividualAggregator : Object
*/
public async void remove_individual (Individual individual) throws GLib.Error
{
- foreach (unowned Persona persona in individual.personas)
- yield persona.store.remove_persona (persona);
+ /* We have to iterate manually since using foreach() requires a sync
+ * lambda function, meaning we can't yield on the remove_persona() call */
+ unowned GLib.List<unowned Persona> i;
+ for (i = individual.personas; i != null; i = i.next)
+ {
+ unowned Persona persona = (Persona) i.data;
+ yield persona.store.remove_persona (persona);
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]