Individual candidate_ind = this.link_map.lookup (persona.iid);
if (candidate_ind != null)
{
- debug (" Found candidate individual '%s' by IID.",
- candidate_ind.id);
+ debug (" Found candidate individual '%s' by IID '%s'.",
+ candidate_ind.id, persona.iid);
candidate_inds.prepend (candidate_ind);
candidate_ind_set.add (candidate_ind);
}
persona.linkable_property_to_links (prop_name, (l) =>
{
+ string prop_linking_value = (string) l;
Individual candidate_ind =
- this.link_map.lookup ((string) l);
+ this.link_map.lookup (prop_linking_value);
+
if (candidate_ind != null &&
!candidate_ind_set.contains (candidate_ind))
{
+ debug (" Found candidate individual '%s' by " +
+ "linkable property '%s' = '%s'.",
+ candidate_ind.id, prop_name, prop_linking_value);
candidate_inds.prepend (candidate_ind);
candidate_ind_set.add (candidate_ind);
}
if (candidate_inds != null)
{
- debug (" Found candidate individuals:");
-
/* The Persona's IID or linkable properties match one or more
* linkable fields which are already in the link map, so we link
* together all the Individuals we found to form a new
{
unowned Individual individual = (Individual) i;
- debug (" %s", individual.id);
-
/* FIXME: It would be faster to prepend a reversed copy of
* `individual.personas`, then reverse the entire
* `final_personas` list afterwards, but Vala won't let us.
{
unowned Persona final_persona = (Persona) i;
- debug (" %s", final_persona.uid);
+ debug (" %s (%s)", final_persona.uid, final_persona.iid);
/* Only add the Persona to the link map if we trust its IID. */
if (trust_level != PersonaStoreTrust.NONE)
* fully trust the PersonaStore it came from. */
if (final_persona.store.trust_level == PersonaStoreTrust.FULL)
{
+ debug (" Inserting links:");
+
/* Insert maps from the Persona's linkable properties to the
* Individual. */
foreach (string prop_name in
final_persona.linkable_property_to_links (prop_name,
(l) =>
{
- this.link_map.replace ((string) l, final_individual);
+ string prop_linking_value = (string) l;
+
+ debug (" %s", prop_linking_value);
+ this.link_map.replace (prop_linking_value,
+ final_individual);
});
}
}
if (added != null)
added_individuals = this.add_personas (added);
+ debug ("Removing Personas:");
+
removed.foreach ((p) =>
{
unowned Persona persona = (Persona) p;
PersonaStoreTrust trust_level = persona.store.trust_level;
+ debug (" %s (%s)", persona.uid, persona.iid);
+
/* Build a hash table of the removed Personas so that we can quickly
* eliminate them from the list of Personas to relink, below. */
removed_personas.add (persona);
if (trust_level == PersonaStoreTrust.FULL)
{
+ debug (" Removing links:");
+
/* Remove maps from the Persona's linkable properties to
* Individuals. Add the Individuals to a list of Individuals to be
* removed. */
persona.linkable_property_to_links (prop_name, (l) =>
{
- this.link_map.remove ((string) l);
+ string prop_linking_value = (string) l;
+
+ debug (" %s", prop_linking_value);
+ this.link_map.remove (prop_linking_value);
});
}
}
debug ("Relinking Personas:");
foreach (unowned Persona persona in relinked_personas)
- debug (" %s", persona.uid);
+ debug (" %s (%s)", persona.uid, persona.iid);
/* FIXME: Vala is horrible with GLists */
added_individuals.concat (this.add_personas (relinked_personas));
if (replacement != null)
{
- debug ("Individual '%s' removed (replaced by '%s')", i.alias,
- replacement.alias);
+ debug ("Individual '%s' removed (replaced by '%s')", i.id,
+ replacement.id);
}
else
{
- debug ("Individual '%s' removed (not replaced)", i.alias);
+ debug ("Individual '%s' removed (not replaced)", i.id);
}
this.individuals_changed (null, i_list, null, null, 0);
/* Remove all the Personas from writeable PersonaStores
* We have to iterate manually since using foreach() requires a sync
* lambda function, meaning we can't yield on the remove_persona() call */
- debug ("Unlinking Individual '%s', deleting Personas:", individual.alias);
+ debug ("Unlinking Individual '%s', deleting Personas:", individual.id);
/* We have to take a copy of the Persona list before removing the
* Personas, as personas_changed_cb() (which is called as a result of
{
if (persona.store == this.writeable_store)
{
- debug (" %s", persona.uid);
+ debug (" %s (%s)", persona.uid, persona.iid);
yield this.writeable_store.remove_persona (persona);
}
}