From: Raul Gutierrez Segales Date: Fri, 11 Mar 2011 21:54:03 +0000 (-0800) Subject: folks-inspect: handle Structured Names X-Git-Tag: FOLKS_0_4_0~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=986cd0293f51aa47aa6c3af741d448b05769de1b;p=platform%2Fupstream%2Ffolks.git folks-inspect: handle Structured Names Fixes: bgo#644457 - Handle structured names --- diff --git a/NEWS b/NEWS index 55a0acd..265b44d 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ Bugs fixed: * Bug 643954 — Add to_string () to PostalAddress class * Bug 643955 — Add to_string () to RoleOwner class * Bug 643957 — Deal handle birthday and postal-addresses. +* Bug 644457 — Handle structured names API changes: * Add RoleDetails interface diff --git a/folks/name-details.vala b/folks/name-details.vala index f4a42ad..7e6ce76 100644 --- a/folks/name-details.vala +++ b/folks/name-details.vala @@ -15,7 +15,8 @@ * along with this library. If not, see . * * Authors: - * Marco Barisione + * Marco Barisione + * Raul Gutierrez Segales */ using GLib; @@ -162,6 +163,24 @@ public class Folks.StructuredName : Object this._prefixes == "" && this._suffixes == ""; } + + /** + * Formatted version of the structured name. + * + * @since 0.3.UNRELEASED + */ + public string to_string () + { + /* Translators: format for the formatted structured name. + * Parameters (in order) are: prefixes (for the name), given name, + * family name, additional names and (name) suffixes */ + var str = "%s, %s, %s, %s, %s"; + return str.printf (this.prefixes, + this.given_name, + this.family_name, + this.additional_names, + this.suffixes); + } } /** diff --git a/tools/inspect/utils.vala b/tools/inspect/utils.vala index f974851..12e3b17 100644 --- a/tools/inspect/utils.vala +++ b/tools/inspect/utils.vala @@ -341,6 +341,14 @@ private class Folks.Inspect.Utils return output_string; } + else if (prop_name == "structured-name") + { + unowned StructuredName sn = (StructuredName) prop_value.get_object (); + string ret = null; + if (sn != null) + ret = sn.to_string (); + return ret; + } return Utils.transform_value_to_string (prop_value); }