Branch 'libkolabxml-0.8' - src/xcardconversions.h

Christian Mollekopf mollekopf at kolabsys.com
Mon May 20 16:11:17 CEST 2013


 src/xcardconversions.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 99e05f75402b2b19c1f62bd0a4025e6e02b168f6
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Mon May 20 16:09:49 2013 +0200

    Also store preferred parameter if there is no type.
    (cherry picked from commit c17d24338b5960b77614a46d4e95c9a29b9d6e25)
    
    Conflicts:
    	tests/bindingstest.cpp

diff --git a/src/xcardconversions.h b/src/xcardconversions.h
index cab68cb..867563d 100644
--- a/src/xcardconversions.h
+++ b/src/xcardconversions.h
@@ -682,13 +682,15 @@ void writeCard<Kolab::Contact>(vcard_4_0::vcard &vcard, const Kolab::Contact &co
                 emailTypeParam.text().push_back(TypeValueType::work);
             } 
             vcard::tel_type::parameters_type params;
+            if (!emailTypeParam.text().empty()) {
+                params.baseParameter().push_back(emailTypeParam);
+            }
             if(contact.emailAddressPreferredIndex() == index) {
                 params.baseParameter().push_back(vcard_4_0::prefParamType(vcard_4_0::prefParamType::integer_default_value()));
             }
             index++;
 
-            if (!emailTypeParam.text().empty()) {
-                params.baseParameter().push_back(emailTypeParam);
+            if (!params.baseParameter().empty()) {
                 email.parameters(params);
             }
             seq.push_back(email);





More information about the commits mailing list