[folks] folks-inspect: handle emails/urls/phone-numbers



commit 4f43991ec80f0076e58eafc5970e56b73f983801
Author: Raul Gutierrez Segales <raul gutierrez segales collabora co uk>
Date:   Thu Feb 24 15:21:36 2011 +0000

    folks-inspect: handle emails/urls/phone-numbers

 NEWS                     |    2 ++
 tools/inspect/utils.vala |   22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 7226ca9..d00ec3a 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ Bugs fixed:
 * Bug 643241 â?? _update_urls () needs to create copies of each
   List<FieldDetails>
 * Bug 643247 â?? Folks needs C API documentation
+* Bug 643201 â?? folks-inspect can't handle properties which are
+  List<FieldDetails>
 
 Overview of changes from libfolks 0.3.5 to libfolks 0.3.6
 =========================================================
diff --git a/tools/inspect/utils.vala b/tools/inspect/utils.vala
index 725006d..dc0788e 100644
--- a/tools/inspect/utils.vala
+++ b/tools/inspect/utils.vala
@@ -291,6 +291,28 @@ private class Folks.Inspect.Utils
           output_string += " }";
           return output_string;
         }
+      else if (prop_name == "email-addresses" ||
+               prop_name == "urls" ||
+               prop_name == "phone-numbers")
+        {
+          output_string = "{ ";
+          bool first = true;
+          unowned GLib.List<FieldDetails> prop_list =
+              (GLib.List<FieldDetails>) prop_value.get_pointer ();
+
+          foreach (var p in prop_list)
+            {
+              if (!first)
+                {
+                  output_string += ", ";
+                }
+              output_string +=  p.value;
+              first = false;
+            }
+            output_string += " }";
+
+            return output_string;
+        }
 
       return Utils.transform_value_to_string (prop_value);
     }



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