[folks] Add extra debug messages to the key-file backend



commit d9e798cf74f730613cf43753ff6a30822d6de64f
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Mon Aug 30 17:24:49 2010 +0100

    Add extra debug messages to the key-file backend

 backends/key-file/kf-persona-store.vala |    7 +++++++
 backends/key-file/kf-persona.vala       |    9 ++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/backends/key-file/kf-persona-store.vala b/backends/key-file/kf-persona-store.vala
index 54d81df..23c0fb4 100644
--- a/backends/key-file/kf-persona-store.vala
+++ b/backends/key-file/kf-persona-store.vala
@@ -160,6 +160,9 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
    */
   public override async void remove_persona (Folks.Persona persona)
     {
+      debug ("Removing Persona '%s' (IID '%s', group '%s')", persona.uid,
+          persona.iid, persona.display_id);
+
       try
         {
           this.key_file.remove_group (persona.display_id);
@@ -194,6 +197,8 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
               this.type_id, this.id, im_addresses);
         }
 
+      debug ("Adding Persona from details.");
+
       string persona_id = this.first_unused_id.to_string ();
       this.first_unused_id++;
 
@@ -216,6 +221,8 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
     {
       string key_file_data = this.key_file.to_data ();
 
+      debug ("Saving key file '%s'.", this.file.get_path ());
+
       try
         {
           yield this.file.replace_contents_async (key_file_data,
diff --git a/backends/key-file/kf-persona.vala b/backends/key-file/kf-persona.vala
index 4a9375e..e41b355 100644
--- a/backends/key-file/kf-persona.vala
+++ b/backends/key-file/kf-persona.vala
@@ -107,14 +107,17 @@ public class Folks.Backends.Kf.Persona : Folks.Persona,
   public Persona (KeyFile key_file, string id, Folks.PersonaStore store)
     {
       string[] linkable_properties = { "im-addresses" };
+      string iid = store.id + ":" + id;
+      string uid = this.build_uid ("key-file", store.id, id);
 
       Object (display_id: id,
-              iid: store.id + ":" + id,
-              uid: this.build_uid ("key-file", store.id, id),
+              iid: iid,
+              uid: uid,
               store: store,
               linkable_properties: linkable_properties);
 
-      debug ("Adding key-file Persona '%s'", id);
+      debug ("Adding key-file Persona '%s' (IID '%s', group '%s')", uid, iid,
+          id);
 
       this.key_file = key_file;
       this._im_addresses = new HashTable<string, GenericArray<string>> (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]