author | eilers <eilers> | 2005-02-03 10:05:00 (UTC) |
---|---|---|
committer | eilers <eilers> | 2005-02-03 10:05:00 (UTC) |
commit | 9424f9fa34e458c90b5f9bbe2a88074cd9a1161c (patch) (side-by-side diff) | |
tree | a4d94b096a82f49e8b6d4766cc4cae3763350d19 | |
parent | 2ed3b823bdcb473dca8a809b939c5d7d282b70bb (diff) | |
download | opie-9424f9fa34e458c90b5f9bbe2a88074cd9a1161c.zip opie-9424f9fa34e458c90b5f9bbe2a88074cd9a1161c.tar.gz opie-9424f9fa34e458c90b5f9bbe2a88074cd9a1161c.tar.bz2 |
Fixing bug #1236: VCARD contained empty WORK and HOME addressfields..
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index f3b6d56..0ffbb67 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp @@ -454,9 +454,15 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) // home properties - VObject *home_adr= safeAddProp( vcard, VCAdrProp ); - safeAddProp( home_adr, VCHomeProp ); - safeAddPropValue( home_adr, VCStreetAddressProp, c.homeStreet() ); - safeAddPropValue( home_adr, VCCityProp, c.homeCity() ); - safeAddPropValue( home_adr, VCRegionProp, c.homeState() ); - safeAddPropValue( home_adr, VCPostalCodeProp, c.homeZip() ); - safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() ); + if ( !( c.homeStreet().isEmpty() + && c.homeCity().isEmpty() + && c.homeState().isEmpty() + && c.homeZip().isEmpty() + && c.homeCountry().isEmpty() ) ){ + VObject *home_adr= safeAddProp( vcard, VCAdrProp ); + safeAddProp( home_adr, VCHomeProp ); + safeAddPropValue( home_adr, VCStreetAddressProp, c.homeStreet() ); + safeAddPropValue( home_adr, VCCityProp, c.homeCity() ); + safeAddPropValue( home_adr, VCRegionProp, c.homeState() ); + safeAddPropValue( home_adr, VCPostalCodeProp, c.homeZip() ); + safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() ); + } @@ -475,9 +481,15 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) // work properties - VObject *work_adr= safeAddProp( vcard, VCAdrProp ); - safeAddProp( work_adr, VCWorkProp ); - safeAddPropValue( work_adr, VCStreetAddressProp, c.businessStreet() ); - safeAddPropValue( work_adr, VCCityProp, c.businessCity() ); - safeAddPropValue( work_adr, VCRegionProp, c.businessState() ); - safeAddPropValue( work_adr, VCPostalCodeProp, c.businessZip() ); - safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() ); + if ( !( c.businessStreet().isEmpty() + && c.businessCity().isEmpty() + && c.businessState().isEmpty() + && c.businessZip().isEmpty() + && c.businessCountry().isEmpty() ) ){ + VObject *work_adr= safeAddProp( vcard, VCAdrProp ); + safeAddProp( work_adr, VCWorkProp ); + safeAddPropValue( work_adr, VCStreetAddressProp, c.businessStreet() ); + safeAddPropValue( work_adr, VCCityProp, c.businessCity() ); + safeAddPropValue( work_adr, VCRegionProp, c.businessState() ); + safeAddPropValue( work_adr, VCPostalCodeProp, c.businessZip() ); + safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() ); + } |