summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-08 10:39:47 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-10 12:22:29 +0100
commitc2c799bd5bd39de40ef17cdaa7050b6837b088ac (patch)
tree726faa696977e5e5f76796a03db83f7d67ccd98c
parent427b76062a2b677bfc46dac6495e4c19829775c6 (diff)
Add more debugging for aliases
-rw-r--r--backends/key-file/kf-persona.vala3
-rw-r--r--folks/individual.vala18
2 files changed, 20 insertions, 1 deletions
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");
}