author | eilers <eilers> | 2005-02-03 10:05:00 (UTC) |
---|---|---|
committer | eilers <eilers> | 2005-02-03 10:05:00 (UTC) |
commit | 9424f9fa34e458c90b5f9bbe2a88074cd9a1161c (patch) (unidiff) | |
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 | 12 |
1 files changed, 12 insertions, 0 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 | |||
@@ -452,6 +452,11 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) | |||
452 | safeAddPropValue( name, VCNameSuffixesProp, c.suffix() ); | 452 | safeAddPropValue( name, VCNameSuffixesProp, c.suffix() ); |
453 | 453 | ||
454 | // home properties | 454 | // home properties |
455 | if ( !( c.homeStreet().isEmpty() | ||
456 | && c.homeCity().isEmpty() | ||
457 | && c.homeState().isEmpty() | ||
458 | && c.homeZip().isEmpty() | ||
459 | && c.homeCountry().isEmpty() ) ){ | ||
455 | VObject *home_adr= safeAddProp( vcard, VCAdrProp ); | 460 | VObject *home_adr= safeAddProp( vcard, VCAdrProp ); |
456 | safeAddProp( home_adr, VCHomeProp ); | 461 | safeAddProp( home_adr, VCHomeProp ); |
457 | safeAddPropValue( home_adr, VCStreetAddressProp, c.homeStreet() ); | 462 | safeAddPropValue( home_adr, VCStreetAddressProp, c.homeStreet() ); |
@@ -459,6 +464,7 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) | |||
459 | safeAddPropValue( home_adr, VCRegionProp, c.homeState() ); | 464 | safeAddPropValue( home_adr, VCRegionProp, c.homeState() ); |
460 | safeAddPropValue( home_adr, VCPostalCodeProp, c.homeZip() ); | 465 | safeAddPropValue( home_adr, VCPostalCodeProp, c.homeZip() ); |
461 | safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() ); | 466 | safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() ); |
467 | } | ||
462 | 468 | ||
463 | VObject *home_phone = safeAddPropValue( vcard, VCTelephoneProp, c.homePhone() ); | 469 | VObject *home_phone = safeAddPropValue( vcard, VCTelephoneProp, c.homePhone() ); |
464 | safeAddProp( home_phone, VCHomeProp ); | 470 | safeAddProp( home_phone, VCHomeProp ); |
@@ -473,6 +479,11 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) | |||
473 | safeAddProp( url, VCHomeProp ); | 479 | safeAddProp( url, VCHomeProp ); |
474 | 480 | ||
475 | // work properties | 481 | // work properties |
482 | if ( !( c.businessStreet().isEmpty() | ||
483 | && c.businessCity().isEmpty() | ||
484 | && c.businessState().isEmpty() | ||
485 | && c.businessZip().isEmpty() | ||
486 | && c.businessCountry().isEmpty() ) ){ | ||
476 | VObject *work_adr= safeAddProp( vcard, VCAdrProp ); | 487 | VObject *work_adr= safeAddProp( vcard, VCAdrProp ); |
477 | safeAddProp( work_adr, VCWorkProp ); | 488 | safeAddProp( work_adr, VCWorkProp ); |
478 | safeAddPropValue( work_adr, VCStreetAddressProp, c.businessStreet() ); | 489 | safeAddPropValue( work_adr, VCStreetAddressProp, c.businessStreet() ); |
@@ -480,6 +491,7 @@ VObject* OPimContactAccessBackend_VCard::createVObject( const OPimContact &c ) | |||
480 | safeAddPropValue( work_adr, VCRegionProp, c.businessState() ); | 491 | safeAddPropValue( work_adr, VCRegionProp, c.businessState() ); |
481 | safeAddPropValue( work_adr, VCPostalCodeProp, c.businessZip() ); | 492 | safeAddPropValue( work_adr, VCPostalCodeProp, c.businessZip() ); |
482 | safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() ); | 493 | safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() ); |
494 | } | ||
483 | 495 | ||
484 | VObject *work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPhone() ); | 496 | VObject *work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPhone() ); |
485 | safeAddProp( work_phone, VCWorkProp ); | 497 | safeAddProp( work_phone, VCWorkProp ); |