summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>2011-03-05 15:06:55 (GMT)
committerTravis Reitter <travis.reitter@collabora.co.uk>2011-03-11 22:28:37 (GMT)
commit8d7081012d1f8661ef3f729eb4a2c93772958b36 (patch)
treeee22e3939124ff518078572c191f1f6c87f83696
parent47c2dec59010201759dd0a4e845e6618b697be9e (diff)
downloadfolks-8d7081012d1f8661ef3f729eb4a2c93772958b36.tar.gz
folks-8d7081012d1f8661ef3f729eb4a2c93772958b36.tar.xz
folks-inspect: handle birthday/postal-addresses
Fixes: bgo#643957 - Deal handle birthday and postal-addresses.
-rw-r--r--NEWS1
-rw-r--r--tools/inspect/utils.vala28
2 files changed, 29 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 18ee31c..55a0acd 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Bugs fixed:
* Bug 643956 — Use the correct signal name for postal addresses
* Bug 643954 — Add to_string () to PostalAddress class
* Bug 643955 — Add to_string () to RoleOwner class
+* Bug 643957 — Deal handle birthday and postal-addresses.
API changes:
* Add RoleDetails interface
diff --git a/tools/inspect/utils.vala b/tools/inspect/utils.vala
index dc0788e..f974851 100644
--- a/tools/inspect/utils.vala
+++ b/tools/inspect/utils.vala
@@ -313,6 +313,34 @@ private class Folks.Inspect.Utils
return output_string;
}
+ else if (prop_name == "birthday")
+ {
+ unowned DateTime dobj = (DateTime) prop_value.get_boxed ();
+ if (dobj != null)
+ return dobj.to_string ();
+ else
+ return "";
+ }
+ else if (prop_name == "postal-addresses")
+ {
+ output_string = "{ ";
+ bool first = true;
+ unowned GLib.List<PostalAddress> prop_list =
+ (GLib.List<PostalAddress>) prop_value.get_pointer ();
+
+ foreach (var p in prop_list)
+ {
+ if (!first)
+ {
+ output_string += ". ";
+ }
+ output_string += p.to_string ();
+ first = false;
+ }
+ output_string += " }";
+
+ return output_string;
+ }
return Utils.transform_value_to_string (prop_value);
}