summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
index 270bef3..b60c5be 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
@@ -14,12 +14,27 @@
14 * 14 *
15 * ===================================================================== 15 * =====================================================================
16 * Version: $Id$ 16 * Version: $Id$
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.11 2003/08/01 12:30:16 eilers
21 * Merging changes from BRANCH_1_0 to HEAD
22 *
23 * Revision 1.10.4.3 2003/07/23 08:54:37 eilers
24 * Default email was added to the list of all emails, which already contains
25 * the default email..
26 * This closes bug #1045
27 *
28 * Revision 1.10.4.2 2003/07/23 08:44:45 eilers
29 * Importing of Notes in vcard files wasn't implemented.
30 * Closes bug #1044
31 *
32 * Revision 1.10.4.1 2003/06/02 13:37:49 eilers
33 * Fixing memory leak
34 *
20 * Revision 1.10 2003/04/13 18:07:10 zecke 35 * Revision 1.10 2003/04/13 18:07:10 zecke
21 * More API doc 36 * More API doc
22 * QString -> const QString& 37 * QString -> const QString&
23 * QString = 0l -> QString::null 38 * QString = 0l -> QString::null
24 * 39 *
25 * Revision 1.9 2003/03/21 10:33:09 eilers 40 * Revision 1.9 2003/03/21 10:33:09 eilers
@@ -148,12 +163,13 @@ bool OContactAccessBackend_VCard::save()
148 for(QMap<int, OContact>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){ 163 for(QMap<int, OContact>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){
149 vo = createVObject( *it ); 164 vo = createVObject( *it );
150 writeVObject( file.directHandle() , vo ); 165 writeVObject( file.directHandle() , vo );
151 cleanVObject( vo ); 166 cleanVObject( vo );
152 } 167 }
153 cleanStrTbl(); 168 cleanStrTbl();
169 deleteVObject( obj );
154 170
155 m_dirty = false; 171 m_dirty = false;
156 return true; 172 return true;
157 173
158 174
159} 175}
@@ -443,13 +459,15 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
443 } 459 }
444 else if ( name == VCBirthDateProp ) { 460 else if ( name == VCBirthDateProp ) {
445 // Reading Birthdate regarding RFC 2425 (5.8.4) 461 // Reading Birthdate regarding RFC 2425 (5.8.4)
446 c.setBirthday( convVCardDateToDate( value ) ); 462 c.setBirthday( convVCardDateToDate( value ) );
447 463
448 } 464 }
449 465 else if ( name == VCCommentProp ) {
466 c.setNotes( value );
467 }
450#if 0 468#if 0
451 else { 469 else {
452 printf("Name: %s, value=%s\n", name.data(), vObjectStringZValue( o ) ); 470 printf("Name: %s, value=%s\n", name.data(), vObjectStringZValue( o ) );
453 VObjectIterator nit; 471 VObjectIterator nit;
454 initPropIterator( &nit, o ); 472 initPropIterator( &nit, o );
455 while( moreIteration( &nit ) ) { 473 while( moreIteration( &nit ) ) {
@@ -531,13 +549,13 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
531 549
532 VObject *title = safeAddPropValue( vcard, VCTitleProp, c.jobTitle() ); 550 VObject *title = safeAddPropValue( vcard, VCTitleProp, c.jobTitle() );
533 safeAddProp( title, VCWorkProp ); 551 safeAddProp( title, VCWorkProp );
534 552
535 553
536 QStringList emails = c.emailList(); 554 QStringList emails = c.emailList();
537 emails.prepend( c.defaultEmail() ); 555 // emails.prepend( c.defaultEmail() ); Fix for bugreport #1045
538 for( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) { 556 for( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) {
539 VObject *email = safeAddPropValue( vcard, VCEmailAddressProp, *it ); 557 VObject *email = safeAddPropValue( vcard, VCEmailAddressProp, *it );
540 safeAddProp( email, VCInternetProp ); 558 safeAddProp( email, VCInternetProp );
541 } 559 }
542 560
543 safeAddPropValue( vcard, VCNoteProp, c.notes() ); 561 safeAddPropValue( vcard, VCNoteProp, c.notes() );