summaryrefslogtreecommitdiff
path: root/libopie/pim/ocontact.cpp
authorzecke <zecke>2002-11-02 12:36:34 (UTC)
committer zecke <zecke>2002-11-02 12:36:34 (UTC)
commitffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a (patch) (unidiff)
tree601ac645a3768c1fe89fce01243f54a24f08dc15 /libopie/pim/ocontact.cpp
parent74f49994a9c19bdfdbfdfb57a5cf5e1a1f966b53 (diff)
downloadopie-ffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a.zip
opie-ffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a.tar.gz
opie-ffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a.tar.bz2
Fix a vCard problem in OContact
cell phones do not set the UId property... add some more states to otodo
Diffstat (limited to 'libopie/pim/ocontact.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontact.cpp41
1 files changed, 25 insertions, 16 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp
index acd65c4..cd238ef 100644
--- a/libopie/pim/ocontact.cpp
+++ b/libopie/pim/ocontact.cpp
@@ -1129,3 +1129,3 @@ static VObject *createVObject( const OContact &c )
1129 QString birthd_rfc2425 = QString("%1-%2-%3") 1129 QString birthd_rfc2425 = QString("%1-%2-%3")
1130 .arg( c.birthday().year() ) 1130 .arg( c.birthday().year() )
1131 .arg( c.birthday().month(), 2 ) 1131 .arg( c.birthday().month(), 2 )
@@ -1136,3 +1136,3 @@ static VObject *createVObject( const OContact &c )
1136 birthd_rfc2425.replace( pos, 1, "0" ); 1136 birthd_rfc2425.replace( pos, 1, "0" );
1137 1137
1138 qWarning("Exporting birthday as: %s", birthd_rfc2425.latin1()); 1138 qWarning("Exporting birthday as: %s", birthd_rfc2425.latin1());
@@ -1390,3 +1390,3 @@ static OContact parseVObject( VObject *obj )
1390 c.setChildren( value ); 1390 c.setChildren( value );
1391 } 1391 }
1392 else if ( name == VCBirthDateProp ) { 1392 else if ( name == VCBirthDateProp ) {
@@ -1394,3 +1394,3 @@ static OContact parseVObject( VObject *obj )
1394 c.setBirthday( convVCardDateToDate( value ) ); 1394 c.setBirthday( convVCardDateToDate( value ) );
1395 1395
1396 } 1396 }
@@ -1466,3 +1466,12 @@ QValueList<OContact> OContact::readVCard( const QString &filename )
1466 while ( obj ) { 1466 while ( obj ) {
1467 contacts.append( parseVObject( obj ) ); 1467 OContact con = parseVObject( obj );
1468 /*
1469 * if uid is 0 assign a new one
1470 * this at least happens on
1471 * Nokia6210
1472 */
1473 if ( con.uid() == 0 )
1474 con.setUid( 1 );
1475
1476 contacts.append(con );
1468 1477
@@ -1529,3 +1538,3 @@ class QString OContact::recordField( int pos ) const
1529// In future releases, we should store birthday and anniversary 1538// In future releases, we should store birthday and anniversary
1530// internally as QDate instead of QString ! 1539// internally as QDate instead of QString !
1531// QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se) 1540// QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se)
@@ -1536,6 +1545,6 @@ class QString OContact::recordField( int pos ) const
1536void OContact::setBirthday( const QDate &v ) 1545void OContact::setBirthday( const QDate &v )
1537{ 1546{
1538 if ( ( !v.isNull() ) && ( v.isValid() ) ) 1547 if ( ( !v.isNull() ) && ( v.isValid() ) )
1539 replace( Qtopia::Birthday, TimeConversion::toString( v ) ); 1548 replace( Qtopia::Birthday, TimeConversion::toString( v ) );
1540 1549
1541} 1550}
@@ -1555,4 +1564,4 @@ void OContact::setAnniversary( const QDate &v )
1555*/ 1564*/
1556QDate OContact::birthday() const 1565QDate OContact::birthday() const
1557{ 1566{
1558 QString str = find( Qtopia::Birthday ); 1567 QString str = find( Qtopia::Birthday );
@@ -1569,4 +1578,4 @@ QDate OContact::birthday() const
1569*/ 1578*/
1570QDate OContact::anniversary() const 1579QDate OContact::anniversary() const
1571{ 1580{
1572 QDate empty; 1581 QDate empty;
@@ -1575,3 +1584,3 @@ QDate OContact::anniversary() const
1575 if ( !str.isEmpty() ) 1584 if ( !str.isEmpty() )
1576 return TimeConversion::fromString ( str ); 1585 return TimeConversion::fromString ( str );
1577 else 1586 else
@@ -1609,3 +1618,3 @@ void OContact::removeEmail( const QString &v )
1609 QStringList emails = emailList(); 1618 QStringList emails = emailList();
1610 1619
1611 // otherwise, must first contain it 1620 // otherwise, must first contain it
@@ -1642,5 +1651,5 @@ void OContact::setDefaultEmail( const QString &v )
1642 1651
1643 if ( !e.isEmpty() ) 1652 if ( !e.isEmpty() )
1644 insertEmail( e ); 1653 insertEmail( e );
1645 1654
1646} 1655}