folks-inspect: handle emails/urls/phone-numbers
authorRaul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
Thu, 24 Feb 2011 15:21:36 +0000 (15:21 +0000)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Fri, 25 Feb 2011 18:52:19 +0000 (10:52 -0800)
NEWS
tools/inspect/utils.vala

diff --git a/NEWS b/NEWS
index 7226ca9..d00ec3a 100644 (file)
--- 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
 =========================================================
index 725006d..dc0788e 100644 (file)
@@ -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);
     }