summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
authoreilers <eilers>2005-02-03 10:05:00 (UTC)
committer eilers <eilers>2005-02-03 10:05:00 (UTC)
commit9424f9fa34e458c90b5f9bbe2a88074cd9a1161c (patch) (unidiff)
treea4d94b096a82f49e8b6d4766cc4cae3763350d19 /libopie2/opiepim
parent2ed3b823bdcb473dca8a809b939c5d7d282b70bb (diff)
downloadopie-9424f9fa34e458c90b5f9bbe2a88074cd9a1161c.zip
opie-9424f9fa34e458c90b5f9bbe2a88074cd9a1161c.tar.gz
opie-9424f9fa34e458c90b5f9bbe2a88074cd9a1161c.tar.bz2
Fixing bug #1236: VCARD contained empty WORK and HOME addressfields..
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp40
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 )
454 // home properties 454 // home properties
455 VObject *home_adr= safeAddProp( vcard, VCAdrProp ); 455 if ( !( c.homeStreet().isEmpty()
456 safeAddProp( home_adr, VCHomeProp ); 456 && c.homeCity().isEmpty()
457 safeAddPropValue( home_adr, VCStreetAddressProp, c.homeStreet() ); 457 && c.homeState().isEmpty()
458 safeAddPropValue( home_adr, VCCityProp, c.homeCity() ); 458 && c.homeZip().isEmpty()
459 safeAddPropValue( home_adr, VCRegionProp, c.homeState() ); 459 && c.homeCountry().isEmpty() ) ){
460 safeAddPropValue( home_adr, VCPostalCodeProp, c.homeZip() ); 460 VObject *home_adr= safeAddProp( vcard, VCAdrProp );
461 safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() ); 461 safeAddProp( home_adr, VCHomeProp );
462 safeAddPropValue( home_adr, VCStreetAddressProp, c.homeStreet() );
463 safeAddPropValue( home_adr, VCCityProp, c.homeCity() );
464 safeAddPropValue( home_adr, VCRegionProp, c.homeState() );
465 safeAddPropValue( home_adr, VCPostalCodeProp, c.homeZip() );
466 safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() );
467 }
462 468
@@ -475,9 +481,15 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c )
475 // work properties 481 // work properties
476 VObject *work_adr= safeAddProp( vcard, VCAdrProp ); 482 if ( !( c.businessStreet().isEmpty()
477 safeAddProp( work_adr, VCWorkProp ); 483 && c.businessCity().isEmpty()
478 safeAddPropValue( work_adr, VCStreetAddressProp, c.businessStreet() ); 484 && c.businessState().isEmpty()
479 safeAddPropValue( work_adr, VCCityProp, c.businessCity() ); 485 && c.businessZip().isEmpty()
480 safeAddPropValue( work_adr, VCRegionProp, c.businessState() ); 486 && c.businessCountry().isEmpty() ) ){
481 safeAddPropValue( work_adr, VCPostalCodeProp, c.businessZip() ); 487 VObject *work_adr= safeAddProp( vcard, VCAdrProp );
482 safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() ); 488 safeAddProp( work_adr, VCWorkProp );
489 safeAddPropValue( work_adr, VCStreetAddressProp, c.businessStreet() );
490 safeAddPropValue( work_adr, VCCityProp, c.businessCity() );
491 safeAddPropValue( work_adr, VCRegionProp, c.businessState() );
492 safeAddPropValue( work_adr, VCPostalCodeProp, c.businessZip() );
493 safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() );
494 }
483 495