From: Philip Withnall Date: Wed, 8 Sep 2010 09:39:47 +0000 (+0100) Subject: Add more debugging for aliases X-Git-Tag: FOLKS_0_1_17~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2c799bd5bd39de40ef17cdaa7050b6837b088ac;p=platform%2Fupstream%2Ffolks.git Add more debugging for aliases --- diff --git a/backends/key-file/kf-persona.vala b/backends/key-file/kf-persona.vala index bfb669d..66432ab 100644 --- a/backends/key-file/kf-persona.vala +++ b/backends/key-file/kf-persona.vala @@ -51,6 +51,8 @@ public class Folks.Backends.Kf.Persona : Folks.Persona, if (this._alias == value) return; + debug ("Setting alias of Kf.Persona '%s' to '%s'.", this.uid, value); + this._alias = value; this.key_file.set_string (this.display_id, "__alias", value); @@ -136,6 +138,7 @@ public class Folks.Backends.Kf.Persona : Folks.Persona, if (key == "__alias") { this._alias = this.key_file.get_string (this.display_id, key); + debug (" Loaded alias '%s'.", this._alias); continue; } diff --git a/folks/individual.vala b/folks/individual.vala index d20bc3d..9294ef4 100644 --- a/folks/individual.vala +++ b/folks/individual.vala @@ -150,12 +150,16 @@ public class Folks.Individual : Object, this._alias = value; + debug ("Setting alias of individual '%s' to '%s'…", this.id, value); + /* First, try to write it to only the writeable Personas… */ bool alias_changed = false; this._persona_list.foreach ((p) => { if (p is Alias && ((Persona) p).store.is_writeable == true) { + debug (" written to writeable persona '%s'", + ((Persona) p).uid); ((Alias) p).alias = value; alias_changed = true; } @@ -168,7 +172,11 @@ public class Folks.Individual : Object, this._persona_list.foreach ((p) => { if (p is Alias) - ((Alias) p).alias = value; + { + debug (" written to non-writeable persona '%s'", + ((Persona) p).uid); + ((Alias) p).alias = value; + } }); } } @@ -510,6 +518,8 @@ public class Folks.Individual : Object, string alias = null; bool alias_is_display_id = false; + debug ("Updating alias for individual '%s'", this.id); + /* Search for an alias from a writeable Persona, and use it as our first * choice if it's non-empty, since that's where the user-set alias is * stored. */ @@ -527,6 +537,8 @@ public class Folks.Individual : Object, } } + debug (" got alias '%s' from writeable personas", alias); + /* Since we can't find a non-empty alias from a writeable backend, try * the aliases from other personas. Use a non-empty alias which isn't * equal to the persona's display ID as our preference. If we can't find @@ -560,6 +572,8 @@ public class Folks.Individual : Object, } } + debug (" got alias '%s' from non-writeable personas", alias); + if (alias == null) { /* We have to pick a display ID, since none of the personas have an @@ -576,6 +590,8 @@ public class Folks.Individual : Object, * something else undesirable. */ if (this._alias != alias) { + debug ("Changing alias of individual '%s' from '%s' to '%s'.", + this.id, this._alias, alias); this._alias = alias; this.notify_property ("alias"); }