summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
authorzecke <zecke>2003-02-16 22:25:46 (UTC)
committer zecke <zecke>2003-02-16 22:25:46 (UTC)
commit4d0e8ffd8518fe24ed94cfcf92eeff666b014094 (patch) (unidiff)
tree86a0bec752418c409cbc9ad95d6479997dfaf909 /libopie2/opiepim
parent8ecc375c803dc57b160bd0335891fcaf4f6de1df (diff)
downloadopie-4d0e8ffd8518fe24ed94cfcf92eeff666b014094.zip
opie-4d0e8ffd8518fe24ed94cfcf92eeff666b014094.tar.gz
opie-4d0e8ffd8518fe24ed94cfcf92eeff666b014094.tar.bz2
0000276 Fix for that bug.. or better temp workaround
A Preferred Number is HOME|VOICE A CellPhone is HOME|VOICE|CELL the type & HOME|VOICE test triggers both and the cell phone number overrides the other entries.. as a temp I check that it's not equal to HOME|VOICE|CELL before setting the number The right and final fix would be to reorder the if statement to make it if else based and the less common thing put to the bottom OTodoAccessVcal fix the date for beaming
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp82
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.cpp7
2 files changed, 54 insertions, 35 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
index 1dc6b48..622d40a 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
@@ -19,2 +19,17 @@
19 * $Log$ 19 * $Log$
20 * Revision 1.7 2003/02/16 22:25:46 zecke
21 * 0000276 Fix for that bug.. or better temp workaround
22 * A Preferred Number is HOME|VOICE
23 * A CellPhone is HOME|VOICE|CELL the type & HOME|VOICE test
24 * triggers both
25 * and the cell phone number overrides the other entries..
26 *
27 * as a temp I check that it's not equal to HOME|VOICE|CELL before setting the
28 * number
29 *
30 * The right and final fix would be to reorder the if statement to make it
31 * if else based and the less common thing put to the bottom
32 *
33 * OTodoAccessVcal fix the date for beaming
34 *
20 * Revision 1.6 2003/01/13 15:49:31 eilers 35 * Revision 1.6 2003/01/13 15:49:31 eilers
@@ -55,6 +70,6 @@ OContactAccessBackend_VCard::OContactAccessBackend_VCard ( QString , QString fil
55bool OContactAccessBackend_VCard::load () 70bool OContactAccessBackend_VCard::load ()
56{ 71{
57 m_map.clear(); 72 m_map.clear();
58 m_dirty = false; 73 m_dirty = false;
59 74
60 VObject* obj = 0l; 75 VObject* obj = 0l;
@@ -83,3 +98,3 @@ bool OContactAccessBackend_VCard::load ()
83 m_map.insert( con.uid(), con ); 98 m_map.insert( con.uid(), con );
84 99
85 VObject *t = obj; 100 VObject *t = obj;
@@ -97,3 +112,3 @@ bool OContactAccessBackend_VCard::reload()
97bool OContactAccessBackend_VCard::save() 112bool OContactAccessBackend_VCard::save()
98{ 113{
99 if (!m_dirty ) 114 if (!m_dirty )
@@ -119,3 +134,3 @@ bool OContactAccessBackend_VCard::save()
119 return true; 134 return true;
120 135
121 136
@@ -139,3 +154,3 @@ bool OContactAccessBackend_VCard::remove ( int uid )
139 m_dirty = true; 154 m_dirty = true;
140 return true; 155 return true;
141} 156}
@@ -148,3 +163,3 @@ bool OContactAccessBackend_VCard::replace ( const OContact &contact )
148} 163}
149 164
150OContact OContactAccessBackend_VCard::find ( int uid ) const 165OContact OContactAccessBackend_VCard::find ( int uid ) const
@@ -208,3 +223,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
208 OContact c; 223 OContact c;
209 224
210 VObjectIterator it; 225 VObjectIterator it;
@@ -241,3 +256,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
241 QString country; 256 QString country;
242 257
243 VObjectIterator nit; 258 VObjectIterator nit;
@@ -288,3 +303,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
288 int type = 0; 303 int type = 0;
289 304
290 VObjectIterator nit; 305 VObjectIterator nit;
@@ -316,4 +331,5 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
316 type |= VOICE; 331 type |= VOICE;
317 332
318 if ( (type & (VOICE|HOME) ) == (VOICE|HOME) ) 333 qWarning("value %s %d", value.data(), type );
334 if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) )
319 c.setHomePhone( value ); 335 c.setHomePhone( value );
@@ -323,3 +339,3 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
323 c.setHomeMobile( value ); 339 c.setHomeMobile( value );
324 if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) ) 340 if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) )
325 c.setBusinessPhone( value ); 341 c.setBusinessPhone( value );
@@ -408,5 +424,5 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
408 c.setBirthday( convVCardDateToDate( value ) ); 424 c.setBirthday( convVCardDateToDate( value ) );
409 425
410 } 426 }
411 427
412#if 0 428#if 0
@@ -436,6 +452,6 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
436 safeAddPropValue( vcard, VCUniqueStringProp, QString::number(c.uid()) ); 452 safeAddPropValue( vcard, VCUniqueStringProp, QString::number(c.uid()) );
437 453
438 // full name 454 // full name
439 safeAddPropValue( vcard, VCFullNameProp, c.fullName() ); 455 safeAddPropValue( vcard, VCFullNameProp, c.fullName() );
440 456
441 // name properties 457 // name properties
@@ -447,3 +463,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
447 safeAddPropValue( name, VCNameSuffixesProp, c.suffix() ); 463 safeAddPropValue( name, VCNameSuffixesProp, c.suffix() );
448 464
449 // home properties 465 // home properties
@@ -456,3 +472,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
456 safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() ); 472 safeAddPropValue( home_adr, VCCountryNameProp, c.homeCountry() );
457 473
458 VObject *home_phone = safeAddPropValue( vcard, VCTelephoneProp, c.homePhone() ); 474 VObject *home_phone = safeAddPropValue( vcard, VCTelephoneProp, c.homePhone() );
@@ -465,6 +481,6 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
465 safeAddProp( home_phone, VCFaxProp ); 481 safeAddProp( home_phone, VCFaxProp );
466 482
467 VObject *url = safeAddPropValue( vcard, VCURLProp, c.homeWebpage() ); 483 VObject *url = safeAddPropValue( vcard, VCURLProp, c.homeWebpage() );
468 safeAddProp( url, VCHomeProp ); 484 safeAddProp( url, VCHomeProp );
469 485
470 // work properties 486 // work properties
@@ -477,3 +493,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
477 safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() ); 493 safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() );
478 494
479 VObject *work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPhone() ); 495 VObject *work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPhone() );
@@ -489,10 +505,10 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
489 safeAddProp( work_phone, VCPagerProp ); 505 safeAddProp( work_phone, VCPagerProp );
490 506
491 url = safeAddPropValue( vcard, VCURLProp, c.businessWebpage() ); 507 url = safeAddPropValue( vcard, VCURLProp, c.businessWebpage() );
492 safeAddProp( url, VCWorkProp ); 508 safeAddProp( url, VCWorkProp );
493 509
494 VObject *title = safeAddPropValue( vcard, VCTitleProp, c.jobTitle() ); 510 VObject *title = safeAddPropValue( vcard, VCTitleProp, c.jobTitle() );
495 safeAddProp( title, VCWorkProp ); 511 safeAddProp( title, VCWorkProp );
496 512
497 513
498 QStringList emails = c.emailList(); 514 QStringList emails = c.emailList();
@@ -503,5 +519,5 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
503 } 519 }
504 520
505 safeAddPropValue( vcard, VCNoteProp, c.notes() ); 521 safeAddPropValue( vcard, VCNoteProp, c.notes() );
506 522
507 // Exporting Birthday regarding RFC 2425 (5.8.4) 523 // Exporting Birthday regarding RFC 2425 (5.8.4)
@@ -511,3 +527,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
511 } 527 }
512 528
513 if ( !c.company().isEmpty() || !c.department().isEmpty() || !c.office().isEmpty() ) { 529 if ( !c.company().isEmpty() || !c.department().isEmpty() || !c.office().isEmpty() ) {
@@ -518,3 +534,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
518 } 534 }
519 535
520 // some values we have to export as custom fields 536 // some values we have to export as custom fields
@@ -523,3 +539,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
523 safeAddPropValue( vcard, "X-Qtopia-Assistant", c.assistant() ); 539 safeAddPropValue( vcard, "X-Qtopia-Assistant", c.assistant() );
524 540
525 safeAddPropValue( vcard, "X-Qtopia-Spouse", c.spouse() ); 541 safeAddPropValue( vcard, "X-Qtopia-Spouse", c.spouse() );
@@ -532,3 +548,3 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
532 safeAddPropValue( vcard, "X-Qtopia-Children", c.children() ); 548 safeAddPropValue( vcard, "X-Qtopia-Children", c.children() );
533 549
534 return vcard; 550 return vcard;
@@ -546,3 +562,3 @@ QString OContactAccessBackend_VCard::convDateToVCardDate( const QDate& d ) const
546 str_rfc2425.replace( pos, 1, "0" ); 562 str_rfc2425.replace( pos, 1, "0" );
547 563
548 return str_rfc2425; 564 return str_rfc2425;
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp
index e96cc3c..309f9e1 100644
--- a/libopie2/opiepim/backend/otodoaccessvcal.cpp
+++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp
@@ -60,5 +60,8 @@ namespace {
60 60
61 if( event.hasDueDate() ) 61 if( event.hasDueDate() ) {
62 QTime time(0, 0, 0);
63 QDateTime date(event.dueDate(), time );
62 addPropValue( task, VCDueProp, 64 addPropValue( task, VCDueProp,
63 TimeConversion::toISO8601( event.dueDate() ) ); 65 TimeConversion::toISO8601( date ) );
66 }
64 67