folks-inspect: print "web-service-addresses" property correctly
authorAlban Crequy <alban.crequy@collabora.co.uk>
Fri, 8 Apr 2011 13:25:45 +0000 (14:25 +0100)
committerAlban Crequy <alban.crequy@collabora.co.uk>
Fri, 8 Apr 2011 14:17:14 +0000 (15:17 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=647168

NEWS
tools/inspect/utils.vala

diff --git a/NEWS b/NEWS
index aabe896..d01dd7f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Bugs fixed:
 * Deal with duplicated phones/e-mails in Tracker
 * Bug 646944 — Fix libsocialweb updates and removals of contacts
 * Bug 644867 — add interface for linkable web service contact UIDs
+* Bug 647168 — print the "web-service-addresses" property correctly
 
 API changes:
 * Add equal () to StructuredName
index bc73d70..ca54553 100644 (file)
@@ -296,6 +296,39 @@ private class Folks.Inspect.Utils
           output_string += " }";
           return output_string;
         }
+      else if (prop_name == Folks.PersonaStore.detail_key
+          (PersonaDetail.WEB_SERVICE_ADDRESSES))
+        {
+          HashMap<string, LinkedHashSet<string>> web_service_addresses =
+              (HashMap<string, LinkedHashSet<string>>)
+              prop_value.get_object ();
+          output_string = "{ ";
+          bool first = true;
+
+          foreach (var entry in web_service_addresses.entries)
+            {
+              if (first == false)
+                output_string += ", ";
+              output_string += "'%s' : { ".printf ((string) entry.key);
+              first = false;
+
+              LinkedHashSet<string> addresses =
+                  (LinkedHashSet<string>) entry.value;
+              bool _first = true;
+              foreach (var a in addresses)
+                {
+                  if (_first == false)
+                    output_string += ", ";
+                  output_string += "'%s'".printf ((string) a);
+                  _first = false;
+                }
+
+              output_string += " }";
+            }
+
+          output_string += " }";
+          return output_string;
+        }
       else if (prop_name == "email-addresses" ||
                prop_name == "urls" ||
                prop_name == "phone-numbers")