c++/lib c++/tests

Christian Mollekopf mollekopf at kolabsys.com
Wed Mar 21 16:58:28 CET 2012


 c++/lib/xcardconversions.h |    8 +++++++-
 c++/tests/bindingstest.cpp |    1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit abc3460cfe18d1153323ad84e52a2101e5b15b43
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Mar 21 16:58:24 2012 +0100

    Checked and implemented titles.

diff --git a/c++/lib/xcardconversions.h b/c++/lib/xcardconversions.h
index eeaa3b8..ebcde7c 100644
--- a/c++/lib/xcardconversions.h
+++ b/c++/lib/xcardconversions.h
@@ -471,6 +471,10 @@ void writeCard<Kolab::Contact>(vcard_4_0::vcard &vcard, const Kolab::Contact &co
         vcard.fburl(vcard::fburl_type(contact.freeBusyUrl()));
     }
     
+    if (!contact.titles().empty()) {
+        vcard.title(fromList<vcard::title_type>(contact.titles()));
+    }
+    
     if (!contact.affiliations().empty()) {
         vcard::group_sequence affiliations;
         BOOST_FOREACH(const Affiliation &a, contact.affiliations()) {
@@ -483,7 +487,6 @@ void writeCard<Kolab::Contact>(vcard_4_0::vcard &vcard, const Kolab::Contact &co
             if (!a.logo().empty()) {
                 group.logo(affiliationPropType::logo_type(uriInlineEncoding(a.logo(), a.logoMimetype())));
             }
-//             group.title(fromList<affiliationPropType::title_type >(a.titles()));
             group.role(fromList<affiliationPropType::role_type>(a.roles()));
             BOOST_FOREACH(const Related &rel, a.relateds()) {
                 group.related().push_back(fromRelated(rel));
@@ -773,6 +776,9 @@ boost::shared_ptr<Kolab::Contact> readCard <Kolab::Contact> (const vcard_4_0::Vc
     if (vcard.fburl()) {
         contact->setFreeBusyUrl((*vcard.fburl()).uri());
     }
+    if (!vcard.title().empty()) {
+        contact->setTitles(toTextList<vcard::title_type >(vcard.title()));
+    }
     if (!vcard.group().empty()) {
         std::vector<Kolab::Affiliation> list;
         BOOST_FOREACH (const vcard::group_type &group, vcard.group()) {
diff --git a/c++/tests/bindingstest.cpp b/c++/tests/bindingstest.cpp
index 5bd327a..1945615 100644
--- a/c++/tests/bindingstest.cpp
+++ b/c++/tests/bindingstest.cpp
@@ -449,6 +449,7 @@ void BindingsTest::contactCompletness()
     QCOMPARE(e.nameComponents(), c.nameComponents());
     QCOMPARE(e.note(), c.note());
     QCOMPARE(e.freeBusyUrl(), c.freeBusyUrl());
+    QCOMPARE(e.titles(), c.titles());
     QCOMPARE(e.affiliations(), c.affiliations());
     QCOMPARE(e.urls(), c.urls());
     QCOMPARE(e.addresses(), c.addresses());





More information about the commits mailing list